-
Notifications
You must be signed in to change notification settings - Fork 418
Closed
Labels
bug report 🦗Issue is probably a bug, but it needs to be checkedIssue is probably a bug, but it needs to be checkedbundler: webpack 📦Issue is related to webpack bundlerIssue is related to webpack bundlerneeds: complete repro 🖥️Issue need to have complete repro providedIssue need to have complete repro provided
Description
Environment
- Linaria version:
@linaria/[email protected],@linaria/[email protected] - Bundler (+ version): Webpack 5
- Node.js version: Node 16
- OS: N/A
Description
The fixture in the repro case is based on the real project where a lot of "export *" are used. This confuses current parsing/shaking logic and forces to evaluate more code than needed, in this case:
class MockMediaQueryList extends EventTarget {
constructor(media, matches = false) {
super();
this.media = media;
this.matches = matches;
}
}RROR in ./src/index.js
Module build failed (from ./node_modules/@linaria/webpack-loader/lib/index.js):
EvalError: Class extends value undefined is not a constructor or null in
| /home/projects/stackblitz-starters-aw9m5a/src/lib/hooks/useMedia.js
| /home/projects/stackblitz-starters-aw9m5a/src/lib/hooks/index.js
| /home/projects/stackblitz-starters-aw9m5a/src/lib/dialog.js
| /home/projects/stackblitz-starters-aw9m5a/src/lib/index.js
| /home/projects/stackblitz-starters-aw9m5a/src/index.js
at Module.evaluate (file:///home/projects/stackblitz-starters-aw9m5a/node_modules/@linaria/babel-preset/lib/module.js:350:13)
at require.Object.assign.ensure (file:///home/projects/stackblitz-starters-aw9m5a/node_modules/@linaria/babel-preset/lib/module.js:289:13)
at eval (file:///home/projects/stackblitz-starters-aw9m5a/src/lib/hooks/index.js:6:17)
at eval (file:///home/projects/stackblitz-starters-aw9m5a/src/lib/hooks/index.js:28:3)
This fixture is good by two reasons:
- it shows the problem with
export * - it shows the problem with removing DOM related things where they are used in
extends
Reproducible Demo
- Open https://stackblitz.com/edit/stackblitz-starters-aw9m5a
- Run
yarn - Run
yarn webpack
Metadata
Metadata
Assignees
Labels
bug report 🦗Issue is probably a bug, but it needs to be checkedIssue is probably a bug, but it needs to be checkedbundler: webpack 📦Issue is related to webpack bundlerIssue is related to webpack bundlerneeds: complete repro 🖥️Issue need to have complete repro providedIssue need to have complete repro provided