-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Can't resolve './locale' #5472
Comments
@sarazhang123 Can you provide a complete example on stackblitz? Please inform your operating environment This a helps a better positioning solution :). |
I also encountered this issue, it happens when I load the new version from the |
Hello Guys! Reason: Solution:
Step 2: If you are using yarn please add resolutions in your package.json file like this Thank You. |
Continues with 2.25.1 too. |
Same problem over here with 2.25.1! |
All I had to do was update my react project to moment 2.25.1 from 2.4.0 and moment-timezone 0.5.28 from 0.5.26 and the issue presented itself... I had updated to the react-scripts 3.4.1 from 3.3.0 and react/react-dom 16.13.1 from 16.12.0 at the same time. What's killing me is that reverting the package.json back and blowing away node_modules and reinstalling didn't fix the issue, now I'm stuck... |
Same problem for me with 2.25.1 |
How to fix it. Nobody explains.Just waiting. |
Same issue. |
Downgrading to 2.24.0 fixed it for me. |
Hello @sezginriggs @tinyfly @ChrisEddy @mhmtyasr @lucacri please look it. |
Downgrading to the previous minor version ( npm install --save --save-exact moment@2.24.0 |
Related to: #5489 (which somehow seems to have been closed) |
How can we make sure this works with moment-timezone??? |
Pin `moment` at `~2.24.0` in light of multiple issues with `2.25.0`: * [5489](moment/moment#5489) * [5472](moment/moment#5472)
Yes, the problem is the version, Thank for your answer. |
I am seeing a similar issue when trying to build my react project on Github Actions CI. No warnings were emitted when building locally. Downgrading to |
same issue with 2.25.1 |
|
2.25.1 presents the "locale" issue, as others have stated. When I use exactly |
same problem happened in v2.25.1,then I try to add "dependencies" {
"moment": "2.24.0",
},
"resolutions": {
"moment": "2.24.0"
}, |
I went with this bandaid: "dependencies: {
"moment": "^2 <2.25 || ^2 >2.25",
} This avoids forever version pinning to |
Thanks, that's it
…------------------ 原始邮件 ------------------
发件人: "B2D1"<notifications@github.com>;
发送时间: 2020年5月2日(星期六) 中午1:15
收件人: "moment/moment"<moment@noreply.github.com>;
抄送: "喜欢一个人"<383028387@qq.com>; "Comment"<comment@noreply.github.com>;
主题: Re: [moment/moment] Can't resolve './locale' (#5472)
same problem happened in v2.25.1,then I try to add
"dependencies" { "moment": "2.24.0", }, "resolutions": { "moment": "2.24.0" },
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I'm really surprised this was released with this broken. It breaks everyone's web pack. Is there an instance for someone where this works properly? Are we not testing web pack builds? |
I can confirm what others have stated, Waiting for a fix. |
Pin `moment` at `~2.24.0` in light of multiple issues with `2.25.0` ([5489](moment/moment#5489), [5472](moment/moment#5472)). The `resolutions` entry is necessary because `2.25` leaks in via transitive deps. I don't know why it is necessary here when it isn't, say, in ui-circulation, which pulls it in via the same route of stripes-cli and stripes-core. That makes no sense. Alas. Refs [STRIPES-678](https://issues.folio.org/browse/STRIPES-678)
What solved for me was:
|
2.25.2 should address this. You might need to change your webpack configuration if you don't want the locale files to be auto-bundled. |
Pin `moment` at `~2.24.0` in light of multiple issues with `2.25.0` ([5489](moment/moment#5489), [5472](moment/moment#5472)). The `resolutions` entry is necessary because `2.25` leaks in via transitive deps. Refs [STRIPES-678](https://issues.folio.org/browse/STRIPES-678)
Pin `moment` at `~2.24.0` in light of multiple issues with `2.25.0` ([5489](moment/moment#5489), [5472](moment/moment#5472)). The `resolutions` entry is necessary because `2.25` leaks in via transitive deps. Refs [STRIPES-678](https://issues.folio.org/browse/STRIPES-678)
`moment` `v2.25` less than `v2.25.3` caused many webpack-related bugs ([5489](moment/moment#5489), [5472](moment/moment#5472)). Refs STRIPES-678
`moment` `v2.25` less than `v2.25.3` caused many webpack-related bugs ([5489](moment/moment#5489), [5472](moment/moment#5472)). Refs STRIPES-678
Pin `moment` at `~2.24.0` in light of multiple issues with `2.25.0` ([5489](moment/moment#5489), [5472](moment/moment#5472)). Refs [STRIPES-678](https://issues.folio.org/browse/STRIPES-678)
import like this solved for me "moment": "^2.29.4" import * as moment from 'moment' |
i was changed aliasesRequire in require('./locale/' + name);
// because defineLocale currently also sets the global locale, we
// want to undo that for lazy loaded locales to require('moment/locale/' + name);
// because defineLocale currently also sets the global locale, we
// want to undo that for lazy loaded locales and now works without error |
Describe the bug
When I configure
mainFields
of webpack, it outputs errors.To Reproduce
Steps to reproduce the behavior:
Install moment@2.24.0
Modify webpack config file
Use webpack to build bundles
Output some errors on console
Expected behavior
Webpack build successfully.
Screenshots
I modified the highlight line below, webpack build successfully.
I think https://github.com/moment/moment/blob/develop/src/lib/locale/locales.js#L78 has some problem.
The text was updated successfully, but these errors were encountered: