-
Notifications
You must be signed in to change notification settings - Fork 201
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
using createClient
throws a CommonJS warning in Angular
#2122
Comments
Bump and relates to #2157 |
I verified the linked issue was resolved as of Contentful.js 10.9.0+ so I assume this one is too - though I cannot verify this angular specific issue myself, but I would assume this ticket could be closed now |
I am having the same problem with astro. astro: 4.12.2 import { createClient } from "contentful";
export const getStaticPaths = (async ({ paginate }) => {
const client = createClient({
space: "***",
accessToken: "****",
environment: "***",
});
return paginate([], { pageSize: 2 });
})
|
Issues like this should be resolved with our latest SDK version (v11). Can you please test if this new version works for your setup? @msickpaler @nathanlaingzigzag @romeguarin |
Expected Behavior
Contentful package should be available as ES modules.
Any objects imported from contentful should not throw a warning when building in Angular CLI.
Actual Behavior
When
createClient
is used, the Angular CLI throws a warning during build / start commands.warning from angular cli build (this is when installing contentful on a local angular library, imported by the app being built and started):
Possible Workaround
Add
contentful
on angular.json'sallowedCommonJsDependencies
Steps to Reproduce
createClient
fromcontentful
, regardless of its configuration, inside a component's constructor.Context
ESM modules is now the recommended approach instead of CommonJs
Environment
The text was updated successfully, but these errors were encountered: