emscripten-core / emscripten-core/emscripten

file-packager js output not working with closure and --pre-js

Open
#12,701 3 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

I'm getting the following closure error when adding the output of file-packager using `--pre-js`:

> ERROR - [JSC_VAR_MULTIPLY_DECLARED_ERROR] Variable Module declared more than once.

Using `--preload-file` instead works fine which leads me to believe this is a bug.

Commands for completeness:
```bash
file_packager.py testapp.resources.data --preload testapp/resources@resources --js-output=testapp.resources.js --use-preload-cache
em++ -s WASM=1 -DNDEBUG -O3 -s ENVIRONMENT=web -s MODULARIZE -s EXPORT_NAME=createModule -flto --closure 1 -s FORCE_FILESYSTEM --pre-js testapp.resources.js [...]
```

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.