sandpack icon indicating copy to clipboard operation
sandpack copied to clipboard

Sandpack Couldn't Connect To Server

Open sherphclapano opened this issue 3 months ago • 8 comments

Bug report

Packages affected

  • [ ] sandpack-client
  • [ ] sandpack-react

Description of the problem

Preview window displays a "Couldn't connect to server" error after editing a few texts in the code editor.

Image

I have tried opening the Network tab to check for its traffic before refreshing the page. After refreshing, there were 4 loads found. Wasn't sure if they have any relation to the Sandpack error.

I've also tried emptying the Cache and performed a hard reload to the page, but error still pops up after a while. The browser I'm using is Chrome, and I'm borrowing my school's computer to do my coding exercises. Could it be possible that the school's network might be affecting this?

Image

sherphclapano avatar Oct 14 '25 04:10 sherphclapano

@CompuIves / @danilowoz are there any maintainers that can help 🙏

I'm also seeing a lot of server-related errors.

Image
Access to fetch at 'https://sandpack-cdn-v2.codesandbox.io/v2/deps/anNjb2Rlc2hpZnRAbGF0ZXN0' from origin 'https://nodebox-runtime.codesandbox.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
TypeError: Failed to fetch
    at _0x183764 (runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105:519248)
    at _0x5925b9 (runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105:519171)
    at async _0x2089be.fetch (runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105:519718)
    at async _0x2089be.fetchDependencies (runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105:521689)
    at async _0x1b5302.installAllPackages (runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105:528738)
(anonymous) @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
Promise.catch
(anonymous) @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
(anonymous) @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
fire @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
emitNodeCreation @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
addChild @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
writeFileSync @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
_0xc9146e @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
(anonymous) @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
(anonymous) @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
(anonymous) @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105
<computed>.<computed> @ runtime.kaks3iwdou7zahvjrlx9wddqu1cczz3.js:105

danieldelcore avatar Oct 23 '25 22:10 danieldelcore

@aj-foster @JamesACS sorry to ping you folks, I would really appreciate it if someone could look into this 🙏

danieldelcore avatar Oct 30 '25 00:10 danieldelcore

I will take a look at this this morning! I think it's related to an update on our Sandpack CDN. Will follow up

CompuIves avatar Nov 04 '25 07:11 CompuIves

Legend thanks so much @CompuIves

danieldelcore avatar Nov 04 '25 07:11 danieldelcore

What are the steps to repro this? I tried to repro on https://sandpack.codesandbox.io/docs/quickstart but couldn't yet. I am pretty sure it has something to do with the server, but need to get a sense of which request is failing so I can repro it on my local server.

CompuIves avatar Nov 04 '25 07:11 CompuIves

Ah well, the 503 on https://sandpack-cdn-v2.codesandbox.io/v2/deps/anNjb2Rlc2hpZnRAbGF0ZXN0 is a giveaway. Will take a look at that first!

CompuIves avatar Nov 04 '25 07:11 CompuIves

Sorry I'm away from my computer rn, but if you open www.hypermod.io/sandbox and check the network tab you should see it.

danieldelcore avatar Nov 04 '25 07:11 danieldelcore

Okay! It should work again. Apologies for this, it looks like some servers got shuffled and that hit the server for nodebox cdn. Now I've put it on a dedicated server so people do not accidentally remove it.

CompuIves avatar Nov 04 '25 08:11 CompuIves