ericz1803 / react-google-calendar

React Calendar Component that displays data from Google Calendar
https://ericz1803.github.io/react-test-calendar
MIT License
176 stars 63 forks source link

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

Open goanpeca opened 4 months ago

goanpeca commented 4 months ago

Hi @ericz1803, thanks for the awesome project.

We are using this component inside an mdx file using docusaurus. When running the build step, we are getting the following errors:

[WARNING] {"moduleIdentifier":"/Users/gpenacastellanos/Desktop/develop/conda-forge/conda-dot-org/node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","moduleName":"./node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","loc":"2699:33-51","message":"Module not found: Error: Can't resolve './locale' in '/Users/gpenacastellanos/Desktop/develop/conda-forge/conda-dot-org/node_modules/@ericz1803/react-google-calendar/dist'","compilerPath":"client"}

[WARNING] {"moduleIdentifier":"/Users/gpenacastellanos/Desktop/develop/conda-forge/conda-dot-org/node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","moduleName":"./node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","loc":"2699:33-51","message":"Module not found: Error: Can't resolve './locale' in '/Users/gpenacastellanos/Desktop/develop/conda-forge/conda-dot-org/node_modules/@ericz1803/react-google-calendar/dist'","compilerPath":"server"}

I saw this issue https://github.com/ericz1803/react-google-calendar/issues/60, that seems related. Not sure what has changed recently 🤔

Thanks!

goanpeca commented 4 months ago

Hi @ericz1803, thanks for the project :)

We are working with docusaurus, to embed the calendar as a component within an MDX page. We have updated to the latest dependencies, but we are still facing some issues.

4:00:43 PM: [WARNING] {"moduleIdentifier":"/opt/build/repo/node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","moduleName":"./node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","loc":"2699:33-51","message":"Module not found: Error: Can"t resolve "./locale" in "/opt/build/repo/node_modules/@ericz1803/react-google-calendar/dist"","compilerPath":"client"} 4:00:43 PM: [WARNING] {"moduleIdentifier":"/opt/build/repo/node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","moduleName":"./node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","loc":"2699:33-51","message":"Module not found: Error: Can"t resolve "./locale" in "/opt/build/repo/node_modules/@ericz1803/react-google-calendar/dist"","compilerPath":"server"} 4:00:43 PM: Error: Unable to build website for locale en. 4:00:43 PM: at tryToBuildLocale (/opt/build/repo/node_modules/@docusaurus/core/lib/commands/build.js:55:19) 4:00:43 PM: at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 4:00:43 PM: at async mapAsyncSequential (/opt/build/repo/node_modules/@docusaurus/utils/lib/jsUtils.js:44:24) 4:00:43 PM: at async Command.build (/opt/build/repo/node_modules/@docusaurus/core/lib/commands/build.js:82:21) { 4:00:43 PM: [cause]: Error: Failed to compile due to Webpack errors. 4:00:43 PM: Error: Docusaurus server-side rendering could not render static page with path /community/calendar because of error: Cannot read properties of null (reading "registered") 4:00:43 PM: at /opt/build/repo/node_modules/@docusaurus/core/lib/webpack/utils.js:207:24 4:00:43 PM: at /opt/build/repo/node_modules/webpack/lib/MultiCompiler.js:580:14 4:00:43 PM: at processQueueWorker (/opt/build/repo/node_modules/webpack/lib/MultiCompiler.js:517:6) 4:00:43 PM: at process.processTicksAndRejections (node:internal/process/task_queues:77:11) 4:00:43 PM: } 4:00:43 PM: [INFO] Docusaurus version: 3.1.1 4:00:43 PM: Node version: v18.19.1

Do you think is something related to the component, I am not sure what might be causing the issues. Thanks for the help!

daisukeibi commented 3 months ago

Hello @ericz1803

This error seems to be caused by raising 'moment' version to "^2.29.4". I downgraded this library to 4.2.2 and the error no longer appears.

Reference link: https://github.com/moment/moment/issues/5472 Relevant commit: https://github.com/ericz1803/react-google-calendar/commit/510dd9abfe61f9bd22abeb96779d4d4981d7499d#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b64815 75d519R38

I hope this helps and fixes it.