Sandpack error when using artifacts / inconsistent use of artifacts #3989
-
What happened?I've been testing out the new artifact support which is great. However when trying to preview code I get an error. Viewing code works fine. I have tried on Firefox and Edge with exactly the same error. Also I'm uncertain when artifacts are meant to be used and if the artifacts prompt is always sent. For example "Write me a game in Python" does not use artifacts. However if I manually prompt with "Write me a game in Python. Use code artifacts." it does. Steps to Reproduce
What browsers are you seeing the problem on?Firefox, Microsoft Edge Relevant log outputCouldn't connect to server
This means sandpack cannot connect to the runtime or your network is having some issues. Please check the network tab in your browser and try again. If the problem persists, report it via email or submit an issue on GitHub.
ENV: static
ERROR: TIME_OUT ScreenshotsNo response Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Like it says, it’s a network error. The frontend will request the packages needed to render the iframe correctly and something in your network is blocking it |
Beta Was this translation helpful? Give feedback.
-
As for when it should be used, yes the prompt always needs to be sent; however only if you’re requesting mermaid, HTML, React should it be used as it will only support these renderings. For more flexibility, you can enable custom prompt mode, and rely on manual prompting either via presets, assistants instructions or premade prompts. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your replies. I have worked out the Sandpack error. I'm serving over http and hence the service workers wouldn't run as they require https. I phrased my other question badly. "Create a playable snake game" for example automatically uses artifacts. While for Python I need to use a prompt such as "Write me a game in Python. Use code artifacts." or artifacts aren't used. I know that Python won't be executed, however artifacts are useful when making changes to code. |
Beta Was this translation helpful? Give feedback.
-
Hi @thomas-333 , can you please share how did you fixed the Sandpack error? Facing the same issue and I don't understand which network error this is - between my browser and the internet, between librechat host and the browser or other? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Yes absolutely. I realized in hindsight that I should support other languages even if it's simply to render the code side-by-side with no execution. However, there's something exciting regarding python execution in the works!