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
Uncaught Error: Cannot find module './locale' #5484
Comments
Exactly. I just faced this error and saw that they just pushed a new version hours ago. |
if you use yarn, add resolutions block to package.json to override versions of sub-dependency, it work for me
|
Same here! |
Also 2.24.0 still has the warning: |
Just reproduce this problem |
1. Add Account UI 2. Downgrade moment to 2.24.0 moment/moment#5484 3. Remove package-lock.json
Same too! |
|
Same issue, Fixed by removing carret sign before version number. Package.json entry now looks like: It looks like a bug from the new version. |
Tonight I installed Jest and it created a problem and I was instructed to remove any yarn.lock and package.lock files along with my modules folder and do yarn install or npm install. When I did yarn install I received the error mentioned in this thread - the page that appeared said the error was a webpack error and pointed to moment-timezone. When I removed my lock files , module folder and reinstalled using |
Please remove ^ in package.json this way its worked for me 👍 strange such incident happened early this week due to is-promise library there also issue like ^ need to remove. I believe people will now more or less do for all package.json strict version instead of ^ |
Tried removing the caret from package.json and running + |
I am using moment-timezone, and it defaults to 2.25. removing caret makes no difference |
Same here! |
This works for me, I am using create-react-app.
|
It appears there's an issue with their latest version. I had to revert back to "2.24.0" without the "^" and that allowed my sites to build. |
Same problem here with moment version
With moment |
Can someone provide a minimal (non)-working example so this can be investigated? |
i've had to revert to "2.24.0", moment can't find './locale' |
this works perfectly for me : #4216 (comment) |
Hey @ichernev - please find attached. Just run npm install, and npm start :) |
Handling of require was reverted to 2.24.0 behavior. Fixed in 2.25.1. |
I've updated to the version
But maybe I'm doing something wrong. Can anybody confirm that this error has disappeared in 2.25.1 ? |
Same issue for me and moment-timezone. Ive tried forcing 2.24.0, but still same issue since im guessing moment-timezone uses the latest? |
Still getting the error |
@strange1120 is moment@2.25.1? |
@ichernev Sorry, I can confirm 2.25.1 throws the same error. Using the app I uploaded previously, and a clean node_modules/package-lock.json, I can see the version is 2.25.1 but still throws. |
Having the issue with the 2.24, trying to put the "resolutions"... but I didn't update to 2.25, what's wrong? It was working on Thursday. |
Thanks worked! There is a problem with Yarn. Worked with Npm |
Working! <3 |
|
Wouldn’t that be a problem in this version? |
@Shakxzod-Namazbaev I think the original problem was with version 2.25.0, some people reported that the same problem happens in 2.25.1, others have mentioned that downgrading to 2.24 works for them. In my case version 2.25.2 seems to work, so maybe downgrading is not needed |
So you don't have a problem with version 2.25.2 right now, right? |
- Changed to 2.24.0 because having ^ updated it to 2.25.1 which throws an error. There is an issue on github: moment/moment#5484
@Shakxzod-Namazbaev exactly, 2.25.2 works fine for me. |
I can confirm - moment |
I think
|
ver. relevant
I'm not using |
So crazy that this Issue report is still sitting as Closed with so many people affected and the only "solution" so far is to downgrade to an old version!?!?! |
@ichernev Thank you! Updating to 2.25.2 fixes this issue for me! --- a/front/package.json
+++ b/front/package.json
@@ -5,7 +5,7 @@
"dependencies": {
- "moment": "^2.22.2",
+ "moment": "^2.25.2", |
OK. I praised too early. Although with moment ver. E.g.: import moment from "moment"
import "moment/locale/pl"
// set global 'moment' locale (polish)
moment.locale("pl")
// ... somewhere later
console.log(moment().format("DD MMMM YYYY HH:mm:ss")) With version So, version |
I faced the same issue, removing carrot from the version fixed this. Like this in your package.json file --- "moment": "2.24.0" Version : 2.24.0 |
Well, I was testing locally, and I can't really tell why, but if the is a package.json property So this "modern" module property that suppersedes jsnext:main is not just a rename, or an alt name. It has some hidden agenda that is not well advertised. |
2.25.3 is out without |
@ichernev - thanks! I can confirm version |
Fixes in 2.25.3 for me. |
After that works! |
Describe the bug
I get this error on chrome console after I build the production optimized build
Uncaught Error: Cannot find module './locale'
at 2.d0944550.chunk.js:1
at Module. (2.d0944550.chunk.js:1)
at f ((index):1)
at Module.837 (main.091f08fc.chunk.js:1)
at f ((index):1)
at Object.540 (main.091f08fc.chunk.js:1)
at f ((index):1)
at a ((index):1)
at Array.e [as push] ((index):1)
at main.091f08fc.chunk.js:1
This is my package.json
If I build locally with yarn for the dev version it works
To Reproduce
Steps to reproduce the behavior:
Build an app with those requirements. Should get that error on console.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Moment-specific environment
Please run the following code in your environment and include the output:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: