sandpack icon indicating copy to clipboard operation
sandpack copied to clipboard

Failed to get shell by ID

Open lilong7676 opened this issue 1 year ago • 10 comments

Bug report

When use sandpack-client node runtime report error: "Failed to get shell by ID "cltwbor280000039o2o15eqbw"

Packages affected

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

Description of the problem

When use sandpack-client node runtime report error: "Failed to get shell by ID "cltwbor280000039o2o15eqbw" image

What were you doing when the problem occurred?

please see the example sandbox link ⚠️ Open devtools and wait for a few seconds to view the log output. The error message is displayed on the last line

What steps can we take to reproduce the problem?

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Sandpack-client version 2.13.2
Sandpack-react version 2.13.2
Browser Chrome 122.0.6261.112 (Official Build) (arm64)
Operating System macos 14.3.1

lilong7676 avatar Mar 18 '24 02:03 lilong7676

Experiencing the same issue,

Image Image Image

I believe something has gone wrong server-side, potentially. Live example here https://www.hypermod.io/sandbox

danieldelcore avatar Jan 29 '25 02:01 danieldelcore

@CompuIves potentially related to #1229 🙏

danieldelcore avatar Jan 29 '25 02:01 danieldelcore

Interesting... I see a request going to https://3h13fdz-3000.localhost/__csb_bridge/index.html, I don't think it should go to localhost, we normally have a service worker that "catches" the request and then serves something different, but we cannot catch localhost. So we might be detecting the domain wrong, or it could be wrongly configured. I have time this Friday to take a closer look at that!

CompuIves avatar Jan 29 '25 12:01 CompuIves

Thanks for having a look @CompuIves 🙏, LMK what you find. It's happening in prod as well, so not sure how localhost is even getting involved here 🤔.

I'm on latest version of sandpack-react and im using a custom node.js template. If this info helps you narrow it down.

danieldelcore avatar Jan 30 '25 22:01 danieldelcore

I just checked out an old commit from when the project was definitely stable and I'm still seeing the issue, which suggests there may be some sort of change on the server that sandpack calls out to triggering this 🤔

Image

danieldelcore avatar Jan 30 '25 22:01 danieldelcore

I can repro, looking for a fix now.

CompuIves avatar Jan 31 '25 07:01 CompuIves

You're a legend @CompuIves 🚀

danieldelcore avatar Jan 31 '25 07:01 danieldelcore

Fix is live! It's a temporary fix, though, will now work on a more permanent fix :)

CompuIves avatar Jan 31 '25 07:01 CompuIves

Also found the underlying issue, will deploy permanent fix in a moment.

CompuIves avatar Jan 31 '25 08:01 CompuIves

Okay, long-term fix is now live!

CompuIves avatar Jan 31 '25 08:01 CompuIves