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

[v15.0.0-beta.2] Normalization of rules fails #1210

Closed
loilo opened this issue Mar 23, 2018 · 0 comments
Closed

[v15.0.0-beta.2] Normalization of rules fails #1210

loilo opened this issue Mar 23, 2018 · 0 comments

Comments

@loilo
Copy link

loilo commented Mar 23, 2018

Version

15.0.0-beta.2

Reproduction link

https://github.com/Loilo/repro-vue-loader-normalize

Steps to reproduce

Clone the repository and install npm dependencies:

git clone https://github.com/Loilo/repro-vue-loader-normalize.git
cd repro-vue-loader-normalize
npm install

Run webpack:

npx webpack

What is expected?

Webpack should compile.

What is actually happening?

Webpack fails with a very terse Cannot set property 'undefined-0' of undefined and no stack trace.


I've dug into the issue and can make some educated guesses about the details:

  • The normalization of a rule fails.
    It seems to have to do with setting the ident in particular.

    A stack trace is available if the normalization step is invoked manually (node standalone.js in the reproduction repo):

    require('webpack/lib/RuleSet').normalizeRule({
      test: /\.vue$/,
      use: [{
        loader: 'vue-loader',
        options: {}
      }]
    })
  • The error occurs if there's an options property on an object inside a use array:

    {
      test: /\.vue$/,
      use: [{
        loader: 'vue-loader',
        options: {}
      }]
    }

    As opposed to that, it does not occur if the loader and options properties are attached to the rule directly:

    {
      test: /\.vue$/,
      loader: 'vue-loader',
      options: {}
    }
  • The problem happens on every loader, it doesn't need to be the vue-loader itself. (Although that's not unexpected since vue-loader iterates over all loaders.)

Ultimately, I'm not sure if this is an issue with vue-loader or rather with webpack itself.

@loilo loilo changed the title [v15.0.0-beta.2] Normalizing of rules fails [v15.0.0-beta.2] Normalization of rules fails Mar 23, 2018
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