Module not found: Error: Package path . is not exported in react-timezone-select
Describe the bug
Latest version that works [email protected] works Breaking change starts here: [email protected]
Current Webpack version installed "webpack": "^5.95.0", "webpack-cli": "^5.1.4", "webpack-dev-server": "^5.1.0", "webpack-shell-plugin-next": "^2.3.2"
Error message:
Module not found: Error: Package path . is not exported from package in
Reproduction
yarn start
System Info
Current Webpack version installed
"webpack": "^5.95.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
"webpack-shell-plugin-next": "^2.3.2"
Used Package Manager
yarn
Validations
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.
I noticed that in the newer version
"exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js", "require": "./dist/index.cjs" } },
./dist/index.cjs was removed
any workaround, for a really simple use case this has been a dead end.
@ndom91
@alex-ohadi did you find another options?
Yup, I just removed this feature entirely and got the timezone based on the browser. Alex OhadiOn Oct 30, 2024, at 7:19 AM, zthomas1 @.***> wrote: any workaround, for a really simple use case this has been a dead end.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
const [timezone] = useState( Intl.DateTimeFormat().resolvedOptions().timeZone)
You can get various abbreviations and offsets by tweaking this output const abbrev = new Intl.DateTimeFormat('en-US', options).formatToParts(date); const date = new Date(); const offset = date.getTimezoneOffset();
Yeah this component is ESM-only. I won't be publishing cjs versions anymore 🙏