react-timezone-select: Broken with latest react scripts v5?
Since upgrading to react-scripts v5, the following error is produced:
Module not found: Error: Can't resolve './timezone-list' in '/frontend/node_modules/react-timezone-select/dist'
Did you mean 'timezone-list.js'?
BREAKING CHANGE: The request './timezone-list' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
Is anyone else experiencing this issue as well?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 24 (11 by maintainers)
Closing this as this issue has (finally) I believe been laid to rest!
If anyone is still having issues, feel free to open a new one with your details.
@ndom91 Our build, local development, and tests seem to run fine with version 1.3.0.
Thanks!
Awesome, thanks for reporting back! ❤️
Hi, @ndom91 We are trying to make a new build, and now we are receiving this message. ): any ideas? In this manner, we are using React.
From Vercel:
./node_modules/react-timezone-select/dist/index.mjs
15:19:30.019 | Can’t import the named export ‘Component’ from non EcmaScript module (only default export is available)
From IDE: ./src/components/shared/DynamicTimezone/index.js Attempted import error: ‘TimezoneSelect’ is not exported from ‘react-timezone-select’.
Thanks!!
Yes, pointing
main
to the.cjs
version resolved the issue I was having with Jest tests.Fixed it for me. Thank you.