-
Notifications
You must be signed in to change notification settings - Fork 364
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
Preview window not updating with files
prop.
#944
Preview window not updating with files
prop.
#944
Comments
I haven't been able to pinpoint exactly what's going on here, but I was able to simplify the example and recreate the bug: https://codesandbox.io/s/sandpack-bug-preview-not-working-c3nnmy?file=/src/index.tsx. If you switch between the The difference is that the file names change in the "broken" set of files when you click each button. Also, the import statement in the I think this might be an upstream issue with the codesandbox client. I logged the messages that the client sends for both examples. I noticed that the client sends an The Anyways, I probably won't be able to dig any deeper into this for a few days, but hopefully this information can help anyone else who's looking at this. |
I started debugging it on #945 yesterday. But I either couldn't go much further than you too, @SSHari. At first, I suspected a bug in the react hot loader as it failed to update all components in the preview. However, I discovered that editing any file makes it work. It's odd that both scenarios use the same method, flow, and trigger, which doesn't make real sense. I'll try to spend more time today on this issue, as this is something critical and not usual. |
@CTNicholas, we're still investigating this issue. For sure, this is an unexpected behavior on our bundler,and we understand that it may be difficult to resolve. As a temp workaround, I would like to suggest you use a different |
Thank you so much for looking into this @danilowoz! Please let me know if I can help at all. Changing the However, we won't be releasing anything with Sandpack for at least a couple of weeks! I'll ignore the bug for now, and keep checking back on your progress 👍. Thanks again! 🖤 |
Bug report
Packages affected
Description of the problem
Hey, I've got a better repro this time! The preview doesn't always display the correct files after the
SandpackProvider
files
prop has been updated.What were you doing when the problem occurred?
Updating the
files
prop dynamically.What steps can we take to reproduce the problem?
Watch my short Loom video and then open the Sandbox.
TLDW: I'm editing the
files
prop, when the preview updates, it shows an unstyled version of the previous set of files, instead of the current files. The internalsandpack.files
state is correct.Link to sandbox: link (optional)
Your Environment
The text was updated successfully, but these errors were encountered: