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

Module not found: Error: Can't resolve './locale' #224

Closed
fsabreu opened this issue Nov 28, 2017 · 3 comments
Closed

Module not found: Error: Can't resolve './locale' #224

fsabreu opened this issue Nov 28, 2017 · 3 comments

Comments

@fsabreu
Copy link

fsabreu commented Nov 28, 2017

Hi guys,

I using this chart and it's awesome. But I'm getting a warning and I don't know how to resolve.

The warning:
[HMR] bundle has 1 warnings client.js?102b:161 ./node_modules/chart.js/node_modules/moment/src/lib/locale/locales.js Module not found: Error: Can't resolve './locale' in 'C:\Users\Fellipe Abreu\Documents\Trabalhos\SM\trunk\wwwroot\public\react-boilerplate\node_modules\chart.js\node_modules\moment\src\lib\locale' @ ./node_modules/chart.js/node_modules/moment/src/lib/locale/locales.js 55:12-39 @ ./node_modules/chart.js/node_modules/moment/src/lib/locale/locale.js @ ./node_modules/chart.js/node_modules/moment/src/moment.js @ ./node_modules/chart.js/src/scales/scale.time.js @ ./node_modules/chart.js/src/chart.js @ ./node_modules/react-chartjs-2/es/index.js @ ./app/containers/Chart/index.js @ ./app/containers/Chart/Loadable.js @ ./app/containers/App/index.js @ ./app/app.js @ multi eventsource-polyfill webpack-hot-middleware/client?reload=true ./app/app.js

Thanks

@dmaistern
Copy link

Hi,

It's an issue with moment.js and webpack. There is a whole thread about it
moment/moment#1435

What worked for me is the following:

This can be worked around by aliasing 'moment' to 'moment/moment.js' (the commonjs "main") in your webpack config (resolve: { alias: { moment: 'moment/moment.js' } }).

@Pringels
Copy link
Collaborator

Closing for now. Please supply a sandbox or code example with the latest versions of both libraries. If the problem persists, feel free to open a new issue.

@nathanagez
Copy link

nathanagez commented May 2, 2020

For people who still having this issue, here is my solution: moment/moment#4216 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants