Skip to content

Add exports map or "type": "module" #3878

@benmccann

Description

@benmccann

Which package?

I encountered it in intl-messageformat, but it's probably present in additional packages

Describe the bug

The ESM version is referred to only with the module field, but that is not part of the Node.js spec and will only work if you first bundle the code. You must include exports for the ESM version to be accessible in an unbundled Node program

https://nodejs.org/api/packages.html#package-entry-points

To Reproduce

Load intl-messageformat from a Node script without a bundler and it will load the CJS version rather than the ESM version

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions