-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module build failed: unable to use this non-serializable babel config in this node process #1525
Comments
Nothing deliberately changed in 3.x. I wonder if you're getting some state leakage across separate builds. If you see this error, then |
Nope, the error stays the same regardless of whether that folder exists or not. From what I have seen in the debugger, this htmlbars ast transform/plugin gets marked as "global", whatever that means in embroider parlance, and then throws at |
So we debugged this today in the triage meeting. It looks like there is something going on with the addon It looks like they are passing an object to but that required object won't be serializable. I don't know how or why that's a requirement or even if something has changed in this regard recently 🤷 but I found just passing the plugin by name seems to work, even though the repro repo didn't have an example of using the setupPreprocessorRegistry(type, registry) {
registry.add("htmlbars-ast-plugin", {
name: "bind",
plugin: "ember-bind-helper/lib/bind-transform"
});
} |
Thank you! This fixed the problem in this case, but I suspect it will reappear with other addons later: according to EmberObserver codesearch, passing https://emberobserver.com/code-search?codeQuery=plugin%3A%20require |
@mansona thanks, we should add this to the list of things to officially deprecate upstream. We aren't ever going to be able to fully support non-serializable plugins safely. It definitely won't work in vite. Embroider also has a pluginHints option that lets you deal with an addon that is injecting non-serializable plugins. In this case, assuming That still didn't explain why this changed from a warning to an error, because we used to detect whether the config was serializable (and thus safe to parallelized across processes) or not, and force everything to run single-process when it's not serializable. So I went looking and, well, oops:
I guess we need test coverage for this case. |
Many of those are serializable though because they use an explicit API to become so. The first hit I saw on that list is our own The ability to pass a name instead of a function is relatively recent. I added it in babel-plugin-ember-template-compilation. For most of time, addons had to pass a function, but they could annotate it with Since many large apps run with the ember-cli-babel setting |
I get the same error when trying my project with |
Without embroider, add |
Thanks! I have 2:
😄 I have a slight idea that it might be ember-cli-styles but how do I find for sure? |
I'm confused. Having the simplest Ember app - when one adds
Is that known and how does one workaround it? |
I hit this tonight and realized in my case it was because objects with null prototypes are being treated as unserializable. I had an object with a null prototype because I was using |
After updating from embroider 2.x some addons with babel transforms started to break the build.
Were there any changes to those (couldn't find any documentation), or is it a bug?
Repro:
The text was updated successfully, but these errors were encountered: