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

v.1.1.1 throw error when accessing the page #447

Closed
yyzclyang opened this issue Dec 22, 2019 · 7 comments · Fixed by #448
Closed

v.1.1.1 throw error when accessing the page #447

yyzclyang opened this issue Dec 22, 2019 · 7 comments · Fixed by #448

Comments

@yyzclyang
Copy link

  • Operating System: macOS 10.14.6
  • Node Version: 12.14.0
  • NPM Version: 6.13.4 (yarn 1.19.1)
  • webpack Version: 4.41.3
  • style-loader Version: 1.1.1

Expected Behavior

style-loader operating normally

Actual Behavior

After I upgraded from 1.0.2 to 1.1.1, webpack compiles, but I get an error (Uncaught RangeError: Invalid array length) when accessing the webpage.When I downgrade 1.0.2, it's fine.

Code

// webpack.config.js
// If your code blocks are over 20 lines, please paste a link to a gist
// (https://gist.github.com).
{
        test: /\.s?css$/,
        use: [
          "style-loader",
          MiniCssExtractPlugin.loader,
          "css-loader",
          "postcss-loader",
          "sass-loader"
        ]
}

How Do We Reproduce?

Stated in "Actual Behavior".

@saranchandru
Copy link

The same issue is happening with the 1.1.0 version as well.

@syberon
Copy link

syberon commented Dec 23, 2019

Yes, i confirm this too. After updating to 1.1.1 from 1.0.2 i get the same error.

@alexander-akait
Copy link
Member

Somebody can create reproducible test repo?

@yyzclyang
Copy link
Author

yyzclyang commented Dec 24, 2019

Somebody can create reproducible test repo?

here https://github.com/yyzclyang/style-loader-test-repo
@evilebottnawi thank you

@alexander-akait
Copy link
Member

alexander-akait commented Dec 24, 2019

Problem in configuration, you should not use MiniCssExtractPlugin.loader and style-loader together, please fix it using:

{
        test: /\.scss$/,
        use: [
          isDev ? "style-loader" : MiniCssExtractPlugin.loader,
          "css-loader",
          "postcss-loader",
          "sass-loader"
        ]
},

@alexander-akait
Copy link
Member

I will fix it for current version to avoid breaking change, but it doesn't work for next version

@yyzclyang
Copy link
Author

I will fix it for current version to avoid breaking change, but it doesn't work for next version

thank you !

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

Successfully merging a pull request may close this issue.

4 participants