emscripten-core / emscripten-core/emscripten

EXPORT_ES6 + proxy-to-worker produces broken code

Open
#14,164 0 comments 0 reactions 0 assignees View on GitHub
good first bug help wanted
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

This combination of options currently produces a Worker that contains an ES6 export, and main JS that is not an ES module. Then, main JS tries to instantiate a Worker and waits for messages from it, but they never come, since it's just exporting a lazy Module factory.

I see we emit error for regular `MODULARIZE`:

```
-s MODULARIZE=1 is not compatible with --proxy-to-worker (if you want to run in a worker with -s MODULARIZE=1, you likely want to do the worker side setup manually)
```

but for some reason not for `EXPORT_ES6` even though one normally auto-enables another.

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.