-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Closed
Labels
Description
Bug report/breaking change
Im trying experimental feature: #14893
Imagine you have following code
index.js:
import './index.css'
addEventListener("DOMContentLoaded", (event) => {
//do something useful here
})
index.html:
<!DOCTYPE html>
<html>
<head>
<script src="./main.js"></script>
<link rel="stylesheet" href="./main.css"></link>
</head>
<body>
</body>
</html>
What is the current behavior?
This code would fail:
Uncaught TypeError: __webpack_modules__[moduleId] is not a function
at __webpack_require__
If the current behavior is a bug, please provide the steps to reproduce.
Here I made a repo to reproduce:
- Clone https://github.com/IdeaHunter/webpack-serve-css-modules-repro
yarn install
yarn webpack
oryarn webpack serve
What is the expected behavior?
No error should happen or if its intended behavior there should be a friendly error message and there should be a breaking change entry in migration docs for webpack 6
Other relevant information:
webpack version: 5.88.2
Node.js version: 18.16.0
Operating System: windows
Additional tools: yarn
ahansson, JSerFeng and fregante