Skip to content
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

Confusing error message for non-parallelizable plugin #155

Open
dfreeman opened this issue Oct 26, 2018 · 2 comments
Open

Confusing error message for non-parallelizable plugin #155

dfreeman opened this issue Oct 26, 2018 · 2 comments

Comments

@dfreeman
Copy link
Contributor

Babel accepts plugins as (among other things) either a string denoting a module to require, or a tuple containing that string and optionally some configuration for that plugin. It will also accept a singleton array with just the module path as a sort of degenerate version of the second case, i.e.

plugins: [
  '/path/to/some/plugin.js',
  ['/path/to/some/plugin.js', { config: true }],
  ['/path/to/some/plugin.js']
]

For the third entry, the parallelization logic interprets that plugin as ['/path/to/some/plugin.js', undefined], and since undefined isn't JSON-serializable, the plugin is considered unparallelizable. That's easy enough to work around, but the error message we got with throwUnlessParallelizable turned on looked like:

[broccoli-persistent-filter:Babel > [Babel: ember-data]: Babel: ember-data] was configured to `throwUnlessParallelizable` and was unable to parallelize a plugin.
plugins:
1: name: unknown, location: unknown

If the relevant plugin path had been included in that output, it would have helped with tracking down the source of the problem.

@stefanpenner
Copy link
Member

stefanpenner commented Feb 24, 2019

@dfreeman it sounds like the best solution would be for us to simply ignore or custom serialize undefined here right?

@dfreeman
Copy link
Contributor Author

Yep, I think treating ['foo-bar'] as equivalent to bare 'foo-bar' would solve the specific error I was seeing here. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants