-
Notifications
You must be signed in to change notification settings - Fork 97
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
ESM not usable in Node #1927
Comments
You are right, I was facing an error using the ES6 syntax provided in the README : |
I'll take care of this :) |
11 tasks
It's worth noting that the current {
"name": "contentful-management",
"version": "11.31.8",
"description": "Client for Contentful's Content Management API",
"homepage": "https://www.contentful.com/developers/documentation/content-management-api/",
"main": "./dist/contentful-management.node.js",
"browser": "./dist/contentful-management.browser.js",
"types": "./dist/typings/contentful-management.d.ts",
"module": "./dist/es-modules/contentful-management.js",
+ "type": "module",
+ "exports": {
+ "import": "./dist/es-modules/contentful-management.js",
+ "require": "./dist/contentful-management.node.js"
+ }, If you do the following:
import "contentful-management"; You'll get:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently this package is using the "module" package.json field, which is nonstandard and unsupported by node. As a result, node is unable to load ESM code and loads cjs code instead.
This package should define exports in the package.json to properly support ESM.
The text was updated successfully, but these errors were encountered: