-
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
contentful is undefined when importing via ES6 style #2241
Comments
I can confirm I have the same issue in version It would be good to have this addressed though as the ES6 import example in the documentation does not work! |
@y-lobau Interesting, are you using some compiler/transpiler that modifies the import somehow? I wound up on this issue because I actually got the opposite behavior:
{
"name": "example",
"version": "1.0.0",
"private": "true",
"main": "index.js",
"type": "module",
"dependencies": {
"contentful-management": "11.24.3"
}
}
import contentful from "contentful-management";
console.log(contentful.createClient); Running
If I change import { createClient } from "contentful-management";
console.log(createClient); I get:
|
The documentation states:
When running this code from within the Contentful App (react), the contentful variable is undefined.
I was able to make it work with the following instead:
Node.js: v21.7.1
contentful-management: 11.24.3
The text was updated successfully, but these errors were encountered: