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

Error: Cannot find module 'core-js/modules/es6.regexp.to-string' #420

Closed
egor-a-trubnikov-panov opened this issue May 25, 2019 · 22 comments
Closed
Labels
bug 🐛 Issue is a confirmed bug workaround exist Workaround for the issue exist

Comments

@egor-a-trubnikov-panov
Copy link

egor-a-trubnikov-panov commented May 25, 2019

I ran this example on my computer and I got this error:

ERROR in ./src/App.js Module build failed (from ./node_modules/linaria/loader.js): Error: Cannot find module 'core-js/modules/es6.regexp.to-string' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:613:15) at Function.Module._load (internal/modules/cjs/loader.js:539:25) at Module.require (internal/modules/cjs/loader.js:667:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/egortrubnikov-panov/Downloads/linaria-demo 2/node_modules/linaria/lib/loader.js:3:1) at Module._compile (internal/modules/cjs/loader.js:738:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10) at Module.load (internal/modules/cjs/loader.js:630:32) at tryModuleLoad (internal/modules/cjs/loader.js:570:12) at Function.Module._load (internal/modules/cjs/loader.js:562:3)

how can I fix this?

@egor-a-trubnikov-panov
Copy link
Author

I added "core-js": "^2.0.0", in package.json and everything worked

@skywickenden
Copy link
Contributor

skywickenden commented May 26, 2019

Also having this problem. I'm a first time user to Linaria and was simply following the install instructions. I added

"core-js": "^2.6.8"

to devDependencies.

This looks like #361 and should be fixed but isn't

@c01nd01r
Copy link

c01nd01r commented May 26, 2019

Looks like package.json in master branch and npm (https://unpkg.com/linaria@1.3.1/package.json) has differences

diff

img diff

@pbitkowski pbitkowski added the bug 🐛 Issue is a confirmed bug label May 30, 2019
@pbitkowski
Copy link
Contributor

Hi! Thanks for your input. Could you try alpha version?

@le0pard
Copy link
Contributor

le0pard commented May 31, 2019

@pbitkowski thanks. Can you publish 1.4.0-alpha.0 to npm?

@Hotell
Copy link
Contributor

Hotell commented Jun 7, 2019

we are using corejs v3 -> that won't work with linaria 1.3.1.
So if we downgrade to corejs 2 it works but other thing will not work.

  • if we bump to 1.4. hell breaks loose. RangeError: Maximum call stack size exceeded all the things...

🥺

@deklanw
Copy link

deklanw commented Jun 11, 2019

1.4.0-alpha.1 fixed it for me.

But, does it not include Typescript types?

@nhooyr
Copy link

nhooyr commented Jul 1, 2019

Yea it looks like the alpha version doesn't have typescript types.

@nhooyr
Copy link

nhooyr commented Jul 2, 2019

For now I'm just using

declare module "linaria" {
  // @ts-ignore
  export const css
  // @ts-ignore
  export const cx
}

declare module "linaria/react" {
  // @ts-ignore
  export const styled
}

Added into a custom.d.ts file.

@megabayt
Copy link

megabayt commented Jul 12, 2019

any workaround without using alpha version?

I'm getting this when I try to use storybook addons

@JakeAdler
Copy link

Is there a fix in the works for this? Experiencing the same issue.

@Daniel15
Copy link
Contributor

I used yarn add --dev core-js@2 to add the core-js dependency, which worked for me.

@lu-zen
Copy link

lu-zen commented Sep 15, 2019

Core-js 2 is deprecated. There are projects that could depend on core-js latest version features. Any plans to drop v2 on linaria?

@Denis-NV
Copy link

Yea it looks like the alpha version doesn't have typescript types.
yarn add linaria@1.4.0-alpha.1 + custom.d.ts (to avoid TypeScript errors) worked for me.

I'm using firebase in my project. So downgrading core-js to version 2 was not an option for me.

Also, using craco-linaria plugin with craco made it possible to use Linaria in React with create-react-app, but without ejecting

@ElForastero
Copy link

I also ran into this problem with create-react-app and craco plugin for linaria.

@chenyong
Copy link

Run into this as well. Why is linaria using old version of core-js?

@smorimoto
Copy link

By the way, why doesn't release 1.4.0?

@adamseckel
Copy link

if we bump to 1.4. hell breaks loose. RangeError: Maximum call stack size exceeded all the things...

@Hotell did you find a solution for this on the alpha?

@Hotell
Copy link
Contributor

Hotell commented Nov 14, 2019

@Hemlok

@Hotell did you find a solution for this on the alpha?

nope. we had to ditch linaria completely. there is no/lack of activity from maintainers (I don’t blame them, it’s OSS) and relying on unfinished software for business critical features is a no go.

@oreqizer
Copy link

oreqizer commented Dec 10, 2019

So what's going on? Am getting that it cannot find core-js/modules/es7.array.includes in https://github.com/oreqizer/reactizer

It's really a shame, I wanted to use this in production. This is like the holy grail of CSS-in-JS libraries, guys. Keep it alive!

@funkybunky
Copy link

I also ran into this problem with create-react-app and craco plugin for linaria.

Had the same problem and solved it just now by installing the latest beta like so:
npm i -D linaria@1.4.0-beta.1

@jayu
Copy link
Contributor

jayu commented Mar 31, 2020

Thank you for all the responses, I created an issue where we would try to address the problem better. I'm happy that some workarounds exist. Hence I'm closing.

@jayu jayu closed this as completed Mar 31, 2020
@jayu jayu added the workaround exist Workaround for the issue exist label Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Issue is a confirmed bug workaround exist Workaround for the issue exist
Projects
None yet
Development

No branches or pull requests