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

DataCloneError when fetching endpoint in Next.js #8

Closed
2 tasks
CTNicholas opened this issue Feb 20, 2023 · 1 comment · Fixed by codesandbox/sandpack#757
Closed
2 tasks

DataCloneError when fetching endpoint in Next.js #8

CTNicholas opened this issue Feb 20, 2023 · 1 comment · Fixed by codesandbox/sandpack#757
Labels
bug Something isn't working

Comments

@CTNicholas
Copy link

CTNicholas commented Feb 20, 2023

Bug report

Packages affected

  • sandpack-client
  • sandpack-react

Description of the problem

When you fetch an API endpoint in Next.js you get a DataCloneError. Looks like a function isn't serialized for postMessage. If you then "open in CodeSandbox", the error doesn't occur.

chrome_1m4ti9Hfg6

What were you doing when the problem occurred?

Trying to fetch an endpoint.

What steps can we take to reproduce the problem?

Click the button in the sandbox to see the error.

If you "open in CodeSandbox" from the Sandpack demo, you'll see the code works fine there, just not in Sandpack.

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Sandpack-react version 2.0.1
Browser Chrome
Operating System Windows 10

PS: Love the project, thanks for your work on it!

@CTNicholas CTNicholas added the bug Something isn't working label Feb 20, 2023
@danilowoz danilowoz transferred this issue from codesandbox/sandpack Feb 20, 2023
@danilowoz
Copy link
Collaborator

@DeMoorJasper, could you please take a look at this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants