eternagame / EternaJS

Eterna game/RNA design interface
Other
12 stars 10 forks source link

js-polyfills is throwing a ton of errors #49

Open luxaritas opened 6 years ago

luxaritas commented 6 years ago

On loading a puzzle, I get something like this: image

This traces back to js-polyfills/polyfills.js... which we shouldn't even be loading (we only import the keyboard script)? No issues due to this that I can see, but it would be great to get rid of the log spam.

luxaritas commented 6 years ago

Note - this is only in a production build

guyguy2001 commented 3 years ago

If I enable source map and look at the line the error is thrown at: image

And then got to the function that calls it: image

The error is thrown because while the outer function passes a function named for_, define doesn't see the function's name.

If I turn source map off and look at define, we can see that the console.assert is still there, but the function that's passed doesn't have a name: image (The right rectangle is what I search for it by. The highlighted line is the line the debugger is on)

The call to define: image (I'm sure that this is the call because this is the only occurrence of "for" on that line).

I've checked in their repo (in v0.1.42), and polyfill.min.js does not include the problematic console.assert.

My theory is that we use the original polyfill.js (instead of polyfill.min.js) in production build, but our compiler optimized out the function name, but not the console.assert.

EDIT: Apparently, they've documented something similar in their README (https://github.com/inexorabletash/polyfill): image However, this should only apply if we minify our own version of polyfill.js

luxaritas commented 3 years ago

We are minifying the keyboard file ourselves - we shouldn't be using the entire polyfill though. Not quite sure what the deal is there