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

Imports in NPM Packges broken (missing js extension) #2381

Open
jogibear9988 opened this issue Jul 18, 2023 · 2 comments
Open

Imports in NPM Packges broken (missing js extension) #2381

jogibear9988 opened this issue Jul 18, 2023 · 2 comments

Comments

@jogibear9988
Copy link

Describe the bug
I try to load dayjs directly as esm module via a importmap.
This is not possible, cause the imports in the npm module ar emissing the .js extensions

Expected behavior
all imports in javascript should contain extensions

Information

  • Day.js Version : newest
@elizatlawy
Copy link

elizatlawy commented Aug 10, 2023

+1 the import as described in the documentation does not work:

import AdvancedFormat from 'dayjs/plugin/advancedFormat' // ES 2015

It should be:

import AdvancedFormat from 'dayjs/plugin/advancedFormat.js' // ES 2015

I opened a PR to fix this.

@wilkesreid
Copy link

Thanks for this. I was having a hard time figuring out how to use the plugins with ESM.

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

3 participants