codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
13.04k stars 2.27k forks source link

[CRITICAL] Error fetching sandbox #8418

Open brocode101 opened 6 months ago

brocode101 commented 6 months ago

🐛 bug report

Preflight Checklist

Description of the problem

Whenever I try running React through Codesandbox API, it is showing Error fetching sandbox

How has this issue affected you? What are you trying to accomplish?

Our core-product, a design-to-code Figma plugin, Dualite, is down.

To Reproduce

https://codesandbox.io/embed/c3n57m?fontsize=14&hidenavigation=1&theme=dark

Link to sandbox: [link]() (optional)

Your Environment

Software Name/Version
Сodesandbox
Browser
Operating System
filipelima18 commented 6 months ago

Hi,

It seems that the issue is that this Sandbox uses Vite, which is not supported by our in-browser bundler. There are two options to solve this:

  1. Convert the Sandbox to a Devbox (using the "Convert to Devbox" button at the top right of the editor).
  2. Convert the existing Sandbox into a create-react-app project, which works natively with our in-browser bundler. This typically can be achieved by moving index.html to a public folder.

If you want it to be a Devbox when generating the Sandbox using the API, you need to create a .codesandbox/devcontainer.json file as well, similar to the one below:

{
"name": "Devcontainer",
"image": "[ghcr.io/codesandbox/devcontainers/typescript-node:latest](http://ghcr.io/codesandbox/devcontainers/typescript-node:latest)"
}

This will automatically make it a Devbox, which natively supports Vite.