Open JakubGortychHG opened 7 months ago
Hi, is sth going on with the ticket? I encountered the same problem using firebaseui web sdk: https://github.com/emscripten-core/emscripten/issues/21594 I checked the newest 3.1.56 release and it din't solve the problem
@kripken would you have time to look into this one?
I found another example: The compilation crashes with the same exception while using initializeApp function https://firebase.google.com/docs/reference/node/firebase#initializeapp (checked with Firebase npm package version 10.8.1)
In the steps in the first comment, where is all.js
? (The problem almost certainly happens because of the content there, that we fail to handle properly.)
I imagine that running the webpack command produces the all.js file?
Ah, thanks. Would it be possible for you to attach that content, @JakubGortychHG ? That would save me a lot of time in setting things up here.
all.zip Ok, @kripken
Thanks @JakubGortychHG
There is a lot of work required to handle that file, which contains many corner cases, including:
The first error is due to this:
const { beforeBreadcrumb: s = null, maxBreadcrumbs: o = Gt } = x;
And you can replace that null
with arbitrary JS, nested inside a VariableDeclarator. The null is a Literal but it could be anything.
I did not look into what the null children are caused by, but in general, this input JS file has lots of JS corner cases. I actually don't think it's feasible for us to handle them all in our custom code: JS is just too large and changing of a language. I suggest instead that we either:
As a workaround for now @JakubGortychHG , you can avoid including that code with --pre-js
. Using --extern-pre-js
would avoid trying to optimize it.
Please include the following in your bug report:
Version of emscripten/emsdk: emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.54 (a95c44ee924d02fa1498f846595485d27c31daa8) I checked 3.1.53 as well.
Failing command line in full: The following exception is thrown when compiling code with -Os
https://github.com/emscripten-core/emscripten/blob/047b82506d6b471873300a5e4d1e690420b582d0/tools/acorn-optimizer.js#L437
The issue is happening after updating @sentry/browser npm package from version 6.19.7 to v7.101.0.
To reproduce the issue create the following files:
a.cpp:
package.json:
webpack.config.js:
index.js:
Then run the following commands: