-
Notifications
You must be signed in to change notification settings - Fork 834
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' #837
Comments
Same issue here |
Same. Supposedly fixed by reverting moment to 2.24.0 - That didn't fix it for me. |
Same issue here. This is currently breaking when built for our dev environment. Running locally appears to work fine. Using CRA-based app. EDIT: I had installed moment-timezone, and was importing moment implicitly. I have attempted to explicitly install the 2.24.0 version, but that does not work. EDIT: since this appears to be a pertinent point, I should note that our breakage is also occurring when deployed via CircleCI. |
I'm having the same issue. Locking to 2.24 doesn't fix it for me either. Intriguingly i'm seeing this when our CI makes production builds, but not in local dev builds. |
Same. In order to test locally I'm having to perform a production build locally and use serve or http-server to start it up. Also using CRA. |
here's moment & moment-timezone in my
It's a react typescript app, with corresponding types for moment-timezone
This is since yesterday, as this build ran successfully on master branch CI then. |
I previously only had "dependencies": {
"moment": "2.24.0",
"moment-timezone": "0.5.28"
},
"resolutions": {
"moment": "2.24.0"
} |
@spacejamtda thank you, this got our dev env back online. |
In my case I was finally able to resolve this by adding
to package.json, and also modifying yarn.lock. I'm using a lerna monorepo and yarn workspaces, so I had to add this to the root package.json so that the resolution prevented yarn from installing 2.25.0 where ^ is used. Sincerely hope this issue is fixed in moment soon! |
@spacejamtda thx. Your solution fixed it for the time being. I'm using CRA, the local builds work fine but the production ones fail. |
I was having this problem suddenly and the way I ultimately fixed it for both local dev and remote prod was to implement @spacejamtda's suggestion (I don't use moment-timezone, though). My package.json did not have the "resolutions" part. I also deleted my package-lock.json file and node_modules directory, reinstalled, and then everything worked. |
I tried the resolution above from @spacejamtda but no luck...we are desperate after fighting this issue all day since 2.25 was released |
The rollback on #5472 from @miguelmota did it for me:
That's the last time I do a package update on a Friday afternoon before a launch :) |
same issue |
I think the @spacejamtda resolutions solution probably works for for people using yarn. I am not sure npm supports resolutions out of the box. I read about npm-force-resolutions, but having problem implementing it. |
Until moment fixes the issue - feel free to use my fork with a locked moment version:
|
Quick update that this was related to monorepo/yarn workspaces and it just requires the
|
Adding the resolutions in your package is only a plaster on a bleeding wound. When is there going to be a final fix? |
I'm a bit confused here, what exactly is the issue with moment and how should we fix it? Would |
After auto-updating to moment 2.25, am getting this error
prototype.js:1 Uncaught Error: Cannot find module './locale'
at prototype.js:1
at Module. (prototype.js:1)
at f ((index):1)
at moment-timezone.js:11
at Object. (moment-timezone.js:6)
at f ((index):1)
at Object. (index.js:1)
at f ((index):1)
at Module.1033 (network.js:27)
at f ((index):1)
The text was updated successfully, but these errors were encountered: