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

Sandpack Next.js Template Fetch With Body Fails #1190

Open
1 of 2 tasks
neocho opened this issue Sep 4, 2024 · 0 comments
Open
1 of 2 tasks

Sandpack Next.js Template Fetch With Body Fails #1190

neocho opened this issue Sep 4, 2024 · 0 comments
Labels

Comments

@neocho
Copy link

neocho commented Sep 4, 2024

Bug report

Hitting a problem with fetch on the Next.js template. When I comment out the body param it works, but it stalls when I add it in. Any ideas on how to fix this?

const response = await fetch('/api/backendRoute', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({"asdf": "asdf"})
});      

Packages affected

  • sandpack-client
  • sandpack-react

Description of the problem

Unable to make fetch requests with a body param.

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

No branches or pull requests

2 participants