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

Loading async chunk gets error when using fullhash #694

Closed
zlk89 opened this issue Feb 6, 2021 · 0 comments · Fixed by #695
Closed

Loading async chunk gets error when using fullhash #694

zlk89 opened this issue Feb 6, 2021 · 0 comments · Fixed by #695

Comments

@zlk89
Copy link

zlk89 commented Feb 6, 2021

  • Operating System: MacOS Catalina
  • Node Version: v12.16.1
  • NPM Version: 6.13.4
  • webpack Version: 5.20.2
  • mini-css-extract-plugin Version: 1.3.5

Expected Behavior

Load the website correctly

Actual Behavior

Loading it on browser, gets this error:

3ad75b68b6c11f8210e7.js:384 Uncaught (in promise) TypeError: __webpack_require__.h is not a function
    at Function.__webpack_require__.miniCssF (3ad75b68b6c11f8210e7.js:384)
    at 3ad75b68b6c11f8210e7.js:536
    at new Promise (<anonymous>)
    at loadStylesheet (3ad75b68b6c11f8210e7.js:535)
    at Object.__webpack_require__.f.miniCss (3ad75b68b6c11f8210e7.js:551)

Code

// webpack.config.js, see the reprod repo for more details
new MiniCssExtractPlugin({
    filename: '[fullhash].css',
    chunkFilename: '[fullhash].chunk.css',
})
// In index.js, load scss in a separate chunk
import('./style.css');

How Do We Reproduce?

  1. Go to this repro and branch /~https://github.com/zlk89/webpack-reprods/tree/mini-css-breaks-fullhash
  2. yarn install
  3. yarn start
  4. Open http://localhost:8080/ you will see the error on console

This bug only happens when you use fullhash in the css name, and async loading the css file

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.

1 participant