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

Loader crashes when no options are supplied #412

Closed
billyjanitsch opened this issue Mar 6, 2017 · 3 comments
Closed

Loader crashes when no options are supplied #412

billyjanitsch opened this issue Mar 6, 2017 · 3 comments

Comments

@billyjanitsch
Copy link

I'm submitting a bug report

Webpack Version:
2.2.1

Babel Core Version:
6.23.1

Babel Loader Version:
7.0.0-alpha.2

Please tell us about your environment:
OSX 10.12.3

Current behavior:
babel-loader crashes when no options are supplied:

Module build failed: TypeError: Cannot read property 'babelrc' of null

Expected/desired behavior:
Supplying no options should be supported.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your webpack configuration.
{
  test: /\.js$/,
  use: 'babel-loader',
  // don't pass any options to the loader
}

The issue is that loader-utils' getOptions returns null if no options are supplied to the loader, so you can't access properties assuming that it will be an object. Appending || {} to L96 should fix it, but I haven't had a chance to verify.

@pugnascotia
Copy link

I'm seeing this too. @billyjanitsch's analysis correlates with what I found.

@danez danez added this to the 7.0.0 milestone Mar 6, 2017
@danez
Copy link
Member

danez commented Mar 6, 2017

Ok I fixed it in 7.0.0-alpha.3

Sorry.

@danez danez closed this as completed Mar 6, 2017
@billyjanitsch
Copy link
Author

Thanks for the quick fix!

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

No branches or pull requests

4 participants