Skip to content
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 JS library doesn't work in nextjs edge runtime #2051

Open
RProduction opened this issue Nov 5, 2023 · 2 comments
Open

Contentful JS library doesn't work in nextjs edge runtime #2051

RProduction opened this issue Nov 5, 2023 · 2 comments

Comments

@RProduction
Copy link

Expected Behavior

It should return entry object

Actual Behavior

Console log shows
[Error: Adapter 'http' is not available in the build]

Possible Solution

Provide fetch API from contentful library

Steps to Reproduce

  1. Initialize contentful client
  2. set nextjs runtime to edge
  3. execute get query

Context

Environment

  • Language Version: 20.9.0
  • Package Manager Version: 10.1.0
@marcolink
Copy link
Member

Hi @RProduction,
Have you already tried using an axios adapter for your edge environment?
You can find some infos on how to set your own axios adapter in this thread.

@MickL
Copy link

MickL commented Jan 24, 2024

contenful.js should not use Axios and instead use fetch directly or another library to support Edge Workers like Vercel Edge Functions or Cloudflare Workers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants