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

exports field in package.json breaks CJS imports #181

Closed
PaulLeCam opened this issue Jun 2, 2021 · 4 comments · Fixed by #182
Closed

exports field in package.json breaks CJS imports #181

PaulLeCam opened this issue Jun 2, 2021 · 4 comments · Fixed by #182
Labels
bug Something isn't working released

Comments

@PaulLeCam
Copy link

Describe the bug
This change breaks CJS imports of the module:

[...]/did-jwt/lib/index.modern.js:1
import { toString, fromString, concat } from 'uint8arrays';
^^^^^^

SyntaxError: Cannot use import statement outside a module

To Reproduce
Try to import the module, for example node -e "require('did-jwt')"

Expected behavior
Module can be imported

Desktop (please complete the following information):

  • OS: macOS
  • Version: 10.14

Additional context
Using the exports field in package.json doesn't imply the file uses ESM, see https://nodejs.org/dist/latest-v16.x/docs/api/packages.html#packages_exports.

@mirceanis mirceanis added bug Something isn't working triage This issue is currently being examined labels Jun 2, 2021
@mirceanis
Copy link
Member

thank you for your vigilance. looking into it now

mirceanis added a commit that referenced this issue Jun 2, 2021
@mirceanis mirceanis removed the triage This issue is currently being examined label Jun 2, 2021
uport-automation-bot pushed a commit that referenced this issue Jun 2, 2021
## [5.5.2](5.5.1...5.5.2) (2021-06-02)

### Bug Fixes

* remove `exports` statement from package.json ([#182](#182)) ([5dbd6df](5dbd6df)), closes [#181](#181)
@mirceanis
Copy link
Member

can you try again with version 5.5.2 ?

Please reopen if it still looks broken

@uport-automation-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 5.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@PaulLeCam
Copy link
Author

Yes it works with 5.5.2, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants