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 field in package.json doesn't point to an esm module. #598

Closed
antony opened this issue May 15, 2019 · 6 comments · Fixed by #1298
Closed

module field in package.json doesn't point to an esm module. #598

antony opened this issue May 15, 2019 · 6 comments · Fixed by #1298
Labels

Comments

@antony
Copy link

antony commented May 15, 2019

Describe the bug
module field in package.json points to minified version of the library.

Also causes issues when using npm link across modules for development (minified file cannot be found / imported)

Expected behavior
module field should point to the esm distribution so that it can be imported by consuming projects and tree-shaken / imported correctly.

Information

  • Day.js Version 1.8.14
@iamkun
Copy link
Owner

iamkun commented May 15, 2019

#492

We have a related issue.

23f9f3d

@antony
Copy link
Author

antony commented May 15, 2019

Ah okay - this is catching a few people out / deterring them from using the module.

Not sure if there is a "proper" fix for this as I'm no expert. I'll switch to dayjs/esm for now.

@iamkun
Copy link
Owner

iamkun commented May 15, 2019

Yes, you could switch to dayjs/esm at this time.

@arjunyel
Copy link

arjunyel commented Jun 4, 2019

When I try to use dayjs/esm (import * as dayjs from 'dayjs/esm') or (import dayjs from 'dayjs/esm') in VS Code angular project it says

Could not find a declaration file for module 'dayjs/esm'. '**/node_modules/dayjs/esm/index.js' implicitly has an 'any' type.
Try npm install @types/dayjs if it exists or add a new declaration (.d.ts) file containing declare module 'dayjs/esm';

@fjc0k
Copy link

fjc0k commented May 30, 2020

@iamkun Anyway, I think we shouldn't provide error format distribution (cjs or umd) for the module field, if so, Why not remove the module field?

image

iamkun pushed a commit that referenced this issue Jan 3, 2021
# [1.10.0](v1.9.8...v1.10.0) (2021-01-03)

### Bug Fixes

* add ordinal to localeData plugin ([#1266](#1266)) ([fd229fa](fd229fa))
* add preParsePostFormat plugin & update Arabic [ar] locale ([#1255](#1255)) ([f2e4790](f2e4790))
* add type support for plural forms of units ([#1289](#1289)) ([de49bb1](de49bb1))
* escape last period to match only milliseconds ([#1239](#1239)) ([#1295](#1295)) ([64037e6](64037e6))

### Features

* add ES6 Module Support, package.json module point to "esm/index.js" ([#1298](#1298)) ([f63375d](f63375d)), closes [#598](#598) [#313](#313)
@iamkun
Copy link
Owner

iamkun commented Jan 3, 2021

🎉 This issue has been resolved in version 1.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun iamkun added the released label Jan 3, 2021
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
# [1.10.0](iamkun/dayjs@v1.9.8...v1.10.0) (2021-01-03)

### Bug Fixes

* add ordinal to localeData plugin ([#1266](iamkun/dayjs#1266)) ([fd229fa](iamkun/dayjs@fd229fa))
* add preParsePostFormat plugin & update Arabic [ar] locale ([#1255](iamkun/dayjs#1255)) ([f2e4790](iamkun/dayjs@f2e4790))
* add type support for plural forms of units ([#1289](iamkun/dayjs#1289)) ([de49bb1](iamkun/dayjs@de49bb1))
* escape last period to match only milliseconds ([#1239](iamkun/dayjs#1239)) ([#1295](iamkun/dayjs#1295)) ([64037e6](iamkun/dayjs@64037e6))

### Features

* add ES6 Module Support, package.json module point to "esm/index.js" ([#1298](iamkun/dayjs#1298)) ([f63375d](iamkun/dayjs@f63375d)), closes [#598](iamkun/dayjs#598) [#313](iamkun/dayjs#313)
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
# [1.10.0](iamkun/dayjs@v1.9.8...v1.10.0) (2021-01-03)

### Bug Fixes

* add ordinal to localeData plugin ([#1266](iamkun/dayjs#1266)) ([fd229fa](iamkun/dayjs@fd229fa))
* add preParsePostFormat plugin & update Arabic [ar] locale ([#1255](iamkun/dayjs#1255)) ([f2e4790](iamkun/dayjs@f2e4790))
* add type support for plural forms of units ([#1289](iamkun/dayjs#1289)) ([de49bb1](iamkun/dayjs@de49bb1))
* escape last period to match only milliseconds ([#1239](iamkun/dayjs#1239)) ([#1295](iamkun/dayjs#1295)) ([64037e6](iamkun/dayjs@64037e6))

### Features

* add ES6 Module Support, package.json module point to "esm/index.js" ([#1298](iamkun/dayjs#1298)) ([f63375d](iamkun/dayjs@f63375d)), closes [#598](iamkun/dayjs#598) [#313](iamkun/dayjs#313)
allmoviestvshowslistsfilmography28 added a commit to allmoviestvshowslistsfilmography28/dayjs that referenced this issue Sep 12, 2024
# [1.10.0](iamkun/dayjs@v1.9.8...v1.10.0) (2021-01-03)

### Bug Fixes

* add ordinal to localeData plugin ([#1266](iamkun/dayjs#1266)) ([33cd889](iamkun/dayjs@33cd889))
* add preParsePostFormat plugin & update Arabic [ar] locale ([#1255](iamkun/dayjs#1255)) ([1d5566d](iamkun/dayjs@1d5566d))
* add type support for plural forms of units ([#1289](iamkun/dayjs#1289)) ([05d8ea8](iamkun/dayjs@05d8ea8))
* escape last period to match only milliseconds ([#1239](iamkun/dayjs#1239)) ([#1295](iamkun/dayjs#1295)) ([7bbfe0a](iamkun/dayjs@7bbfe0a))

### Features

* add ES6 Module Support, package.json module point to "esm/index.js" ([#1298](iamkun/dayjs#1298)) ([85bd4a1](iamkun/dayjs@85bd4a1)), closes [#598](iamkun/dayjs#598) [#313](iamkun/dayjs#313)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants