linaria icon indicating copy to clipboard operation
linaria copied to clipboard

Cannot find module 'core-js/modules/es.array.iterator.js'

Open iamyuu opened this issue 5 years ago • 6 comments

Environment

System:
  OS: macOS 11.4
Binaries:
  Node: 14.17.0
  npm: 7.19.1
npmPackages:
  @linaria/babel-preset: 3.0.0-beta.4
  @linaria/core: 3.0.0-beta.4
  @linaria/react: 3.0.0-beta.7
  @linaria/shaker: 3.0.0-beta.7
  @linaria/webpack-loader: 3.0.0-beta.7
  next: 11.0.1
  webpack: 5

Description

I'm trying to use linaria version 3-beta in next.js, but when starting the development server it's throwing the error MODULE_NOT_FOUND, see the screenshot below:

Screen Shot 2021-07-11 at 20 07 31

Reproducible Demo

I'm using [email protected]

Repository for reproduce: next-linaria-beta-repro

iamyuu avatar Jul 11 '21 13:07 iamyuu

I solved this problem by installing core-js manually, but of course this is not a package level solution

pure-engineering avatar Jul 16 '21 13:07 pure-engineering

I'm having the same issue

codejet avatar Jul 18 '21 14:07 codejet

The provided repo works perfectly fine. Could someone please provide a broken one? :)

Anber avatar Jul 22 '21 15:07 Anber

Take a look at here, the difference with the next.js example is the version

next.js example:

  "dependencies": {
    "linaria": "^2.1.0",
    "next": "latest",
    "next-linaria": "^0.10.0",
  },

the broken:

  "dependencies": {
    "@linaria/babel-preset": "3.0.0-beta.4",
    "@linaria/core": "3.0.0-beta.4",
    "@linaria/react": "3.0.0-beta.7",
    "@linaria/shaker": "3.0.0-beta.7",
    "@linaria/webpack-loader": "3.0.0-beta.7",
    "next": "latest",
    "next-linaria": "1.0.0-beta",
  },

iamyuu avatar Jul 22 '21 16:07 iamyuu

Oops. I see it now. It appeared, that our core-js detector is broken and styled requires a lot of polyfills. Thank you!

Anber avatar Aug 08 '21 11:08 Anber

Five excess symbols require 6 additional polyfills. 🤦

Anber avatar Aug 08 '21 12:08 Anber