Open emattias opened 4 years ago
This happens in the browser (not the build) right? What is the full stack trace? Why is it trying to postMessage
the config?
Hmm, actually seems to be in node-land:
https://github.com/nodejs/node/blob/v14.13.0/lib/internal/worker.js#L298
IS that the full stack trace you provided above? I would expect at least a little more context there...
I updated it with more context and stack trace
Nice, that is really useful! I had originally gotten confused by the postMessage
usage (within a project that is actually reasonably going to use postMessage anyways due to the SW aspect), but this is actually just an issue with babel transpilation. By default broccoli-babel-transpiler (which is what ember-cli-babel uses) uses workerpool
to parallelize the babel build (either via threads if on new enough Node, or processes). It seems like the ember-cli-workbox
options from ember-cli-build.js
is being used as part of the configuration for that babel build (but it doesn't really seem like it ought to be) which is what is causing this error.
Can you whip up a reproduction that is largely a npx ember-cli new test-app-here
that I could use to help debug?
Hi @emattias, we moved that option from config/environment
to the ember-cli-build
file for that very reason. I didn't test it on 3.21 but on 3.16 it is working fine.
After updating ember to
3.21.3
we start getting a DataCloneError when theimportScriptsTransform
function is defined inember-cli-build
If you cant have functions in the app config is there some other way to send the function to the addon? Here's a workaround used by
trackJs
for a similar problem.