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: Package path . is not exported in react-timezone-select #133

Open
3 tasks done
alex-ohadi opened this issue Oct 15, 2024 · 5 comments
Open
3 tasks done

Comments

@alex-ohadi
Copy link

Describe the bug

Latest version that works react-timezone-select@2.1.5 works
Breaking change starts here: react-timezone-select@3.2.0

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 /node_modules/react-timezone-select

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

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@alex-ohadi
Copy link
Author

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

@zthomas1
Copy link

zthomas1 commented Oct 30, 2024

any workaround, for a really simple use case this has been a dead end.

@ndom91

@zthomas1
Copy link

@alex-ohadi did you find another options?

@alex-ohadi
Copy link
Author

alex-ohadi commented Oct 30, 2024 via email

@alex-ohadi
Copy link
Author

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();

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

2 participants