You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In NextJs the contentful library is not loading when it's used in the API route.ts file in production.
In development it all working as expected, but when deployed by Vercel as a function the library is undefined.
import contentful from 'contentful';
Here contentful is undefined.
And Sentry is giving back the following error:
TypeError: Cannot read properties of undefined (reading 'getEntries')
Steps to Reproduce
Init next js app as App router.
Fetch contentful's getEntries from /app/api/contentful/route.ts
The library is not initialising correctly in node 20.x environment.
Expected Behavior
getEntries
load the contentActual Behavior
In NextJs the contentful library is not loading when it's used in the API route.ts file in production.
In development it all working as expected, but when deployed by Vercel as a function the library is undefined.
Here contentful is undefined.
And Sentry is giving back the following error:
Steps to Reproduce
Environment
NextJs version: [email protected]
Contentful version: [email protected]
I'm using the REST api of Delivery.
The text was updated successfully, but these errors were encountered: