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

[@mantine/dates] Fix esm mandatory file extensions bug #4875

Merged
merged 1 commit into from Sep 26, 2023

Conversation

BengtHagemeister
Copy link
Contributor

When using @mantine/dates the following error throws:

Error: Cannot find module '/Users/user/code/node_modules/.pnpm/@mantine+dates@7.0.1_@mantine+core@7.0.1_@mantine+hooks@7.0.1_dayjs@1.11.10_react-dom@18.2.0_react@18.2.0/node_modules/dayjs/plugin/utc' imported from /Users/user/code/node_modules/.pnpm/@mantine+dates@7.0.1_@mantine+core@7.0.1_@mantine+hooks@7.0.1_dayjs@1.11.10_react-dom@18.2.0_react@18.2.0/node_modules/@mantine/dates/esm/utils/get-timezone-offset.mjs
Did you mean to import dayjs@1.11.10/node_modules/dayjs/plugin/utc.js?

This is because of the missing .js when bare importing the plugins.

See https://nodejs.org/api/esm.html#esm_mandatory_file_extensions

and iamkun/dayjs#1167 specifically iamkun/dayjs#1167 (comment)

@BengtHagemeister BengtHagemeister changed the title [@mantine/dates] Fix ems mandatory file extensions bug [@mantine/dates] Fix esm mandatory file extensions bug Sep 25, 2023
@theajr
Copy link

theajr commented Sep 26, 2023

@BengtHagemeister is there any other workaround without waiting for this PR to merge?

@rtivital Could you please review and merge or provide any possible solution?

P.S Out of curiosity - How samples are working on docs site?

@rtivital rtivital merged commit 5414f95 into mantinedev:master Sep 26, 2023
1 check passed
@rtivital
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants