linaria icon indicating copy to clipboard operation
linaria copied to clipboard

Webpack crash with ReactRefreshWebpackPlugin and Linaria loader

Open Evalon opened this issue 3 years ago • 0 comments

Environment

  • Linaria version: 4.1.2
  • Bundler (+ version): Webpack 5.74
  • Node.js version: 16.4.2
  • OS: macOS

Description

Webpack crash with ReactRefreshWebpackPlugin and Linaria loader

Module build failed (from ./node_modules/@linaria/webpack5-loader/lib/index.js):
/linaria-simple-repo/node_modules/@linaria/babel-preset/lib/module.js:392
        throw new EvalError(`${e.message} in${callstack.join('\n| ')}\n`);
        ^

EvalError: $RefreshReg$ is not defined in
| /Users/evalon/projects/work/linaria-simple-repo/src/SomeComponent.tsx
| /Users/evalon/projects/work/linaria-simple-repo/src/index.tsx

Reproducible Demo

https://github.com/Evalon/linaria-simple-example

Evalon avatar Sep 08 '22 18:09 Evalon