-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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.object.assign' #12744
Comments
I really want to encounter the same problem. How did you solve it? |
|
I have similar problem, the warning about core-js started to appear since the last update (v2.2.x) |
Does this belong in |
I really want to encounter the same problem. How did you solve it? |
try npm install --save core-js@2 |
So far I've tried both gatsby 2.1.x and 2.2.x, with and without core-js, at versions 2 and 3, deleting caches in between changes. Nothing seems to work. What's surprising is that 2.1.x used to work until I upgraded to 2.2.x. Seems like some child dependency has been upgraded in my node_modules without a lockfile.
|
same problem |
I think we need to update babel-gatsby-preset with @lushijie comment. @rakeshpai Would you like to open a PR for this? |
Oh man. Would have loved to, but I'm not too familiar with gatsby's codebase, and the last time I tried to get a fork running locally, I faced tons of issues getting the build going. |
set corejs version gatsbyjs#12744
* Add corejs to babel-preset-gatsby's config Fixes #12744 * bump @babel/preset-env to 7.4.1 to allow corejs config value
Hi, just wanted to share that I have one vulnerabilty showing at the root of my gatsby blog. It is:
However, when I went in deeper to fix this, there were much more vulnerabilities and some even critical (I am on gatsby 2.2.5. And many as also mentioned by @rakeshpai did not have lock files. When I would add one, more vulnerabilities revealed themselves. Including for babel related stuff. Just FYI. Couldn't even resolve all of them completely. |
+1 for missing lockfiles. My local install of gatsby is now fubar, and I can't seem to go back to an older version. My error is the same as pasted above - about |
I notice that I have this exactly same issue. |
@anonimoconiglio I've been juggling some similar issues today, and I think the following may resolve your issue- in short upgrade gatsby, then rm your node_modules and reinstall from scratch (but same yarn.lock): yarn upgrade gatsby
# after this you should end up with a bunch of upgrades, including
# gatsby ~ 2.2.9
# babel-preset-gatsby ~ 0.0.10
rm -rf node_modules && yarn I believe that the reason you don't see lockfiles in individual packages is gatsbyjs/gatsby's monorepo structure- the For the specific vulnerability you found @interglobalmedia, that was just reported March 21: https://www.npmjs.com/advisories/788 - it's a requirement of several packages and should be updated but I don't believe it is directly related to this issue. |
@erikdstock Thanks for all the information! FYI,I do not use yarn. I use npm. And the vulnerability shown at the top leads to a several hundred more deeper down. especially when I add a package-lock.json file when prompted to when doing |
I fixed that audit warning in #12844, btw. You'll need to upgrade As I believe the original issue was fixed and we've now fixed this separate issue--let's close it out. Thanks! |
Thanks ! it's OK, Awesome ! |
For posterity, at least part of my issue was that I was hoisting gatsby's node_modules and package.json to fit in the way I had organised my monorepo. Gatsby really doesn't like this kind of hoisting. I've had to reorg parts of my repo (!) so that I don't mess with the Gatsby pieces and my issue seems to be gone. |
@lushijie Not work for me.
|
I'm seeing the same behaviour as @interglobalmedia. Installing Where should the config from @lushijie be added? Adding it to |
Borrowing from a few of the solutions presented above, here's what worked for me. My
Install
Create a file at the project root called
Then when I run |
I saw this in another issue and after some time tracked down to this specific warning that was occurring no matter what I had tried up to then. warning gatsby > @reach/router > create-react-context > fbjs > core-js@1.2.7: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2. so looking at it what it seemed to state was that it can't be less than core-js 2.6.5 so I force installed core-js 2.6.5 and it fixed everything. So it is almost like a circular dependency issue but stemming from reach/router. |
Building with the latest versioned dependencies when building a new Gatsby project doesn't cause any such issues. It's only if you use other libs like By the way, @jjcav84, I encountered the above-mentioned issue but couldn't solve it with
My working setup:
|
In my case I used static properies on class with standart Babel config which does not support static properties on classes. Maybe it will help someone. |
Thank you very much i've lost 4 hours trying fix this. |
I had the same issue. Perhaps i have Node v13.8.0,,, "@babel/core": "^7.8.7", "webpack": "^4.42.0", module.exports = { presets, plugins }; For me works install core-js2: "core-js": "^2.6.11", Hope you find useful these comment :D |
Description
Describe the issue that you're seeing.
When I first ran gatsby develop, I got the warning:
So I installed core-js@3. Then I ran gatsby develop again, and this time I got the error which exited me out of gatsby build:
Steps to reproduce
Clear steps describing how to reproduce the issue. Please please please link to a demo project if possible, this makes your issue much easier to diagnose (seriously).
Expected result
What should happen?
gatsby develop should have resulted in the ability for me to view the project in the browser.
Actual result
What happened.
I am using the default starter. I had a similar issue when using the starter blog, but was not exited out when running gatsby develop. Also did not install core-js. Problems started occurring and I was exited out of the program when I installed core-js@3.
Environment
Run
gatsby info --clipboard
in your project directory and paste the output here.The text was updated successfully, but these errors were encountered: