emscripten-core / emscripten-core/emscripten

Webpack: The request of a dependency is an expression

Open
#19,874 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

## Brief
In a webpack environment, I have a modularized ES6 module with pthreads enabled, that I am trying to import. However, the webpack app (internal to my company but outside my team) gives an error on [this line](https://github.com/emscripten-core/emscripten/blob/main/src/worker.js#L183-L184) of the generated javascript file.

## Metadata
* Version: 3.1.34
* Dev background -- I'm mostly a C++ / embedded developer, not a web development expert. This could be user error, just looking for insights into what might be going on

## Details
Here is a screenshot of the webpack error
![photo_2023-07-18_15-00-43](https://github.com/emscripten-core/emscripten/assets/2337536/7d92e295-cfc5-47b1-b212-0a133648347f)

This error does not occur in any of the other deployments of this internal package. This seems to be related to webpack wanting to resolve imports statically, so is there a flag or something I can set to change this line? We do not go down the `urlOrBlob` code path anyways, at least for my purposes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.