Skip to content
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

Listener is missing to register/emit events in some cases. #71

Closed
JayaKrishnaNamburu opened this issue Jun 29, 2021 · 4 comments · Fixed by #74
Closed

Listener is missing to register/emit events in some cases. #71

JayaKrishnaNamburu opened this issue Jun 29, 2021 · 4 comments · Fixed by #74

Comments

@JayaKrishnaNamburu
Copy link
Contributor

It was quite tricky to point down exactly when it's happening. But at times, the listener from useSandpack is failing to listen for events emitted by the sandpack bundler.
https://codesandbox.io/s/eloquent-mccarthy-qr09r?file=/src/App.tsx

STR

  • Open the console and we should be able to see the logs.
  • Refresh the browser or csb preview. And in some instances the listener won't log the events.
Screen.Recording.2021-06-29.at.8.16.18.AM.mov
@JayaKrishnaNamburu
Copy link
Contributor Author

And i get this error screen for registering listener, sometimes even when not trying to listen for one. Let me know, if i can help in some way to solve both the issues 😄

Screenshot 2021-06-29 at 10 04 46 AM

@alexnm
Copy link
Collaborator

alexnm commented Jun 29, 2021

Thanks for the report, we'll look into it! I also noticed an issue with hot module reload, some listners are not setup properly in the provider

@nkovacic
Copy link

Got the same issue when trying to register multiple Preview windows.

@alexnm
Copy link
Collaborator

alexnm commented Jun 30, 2021

I also found a scenario in which the listeners give an error. Will have to debug this inside the context.

https://codesandbox.io/s/jolly-poincare-zjoxf?file=/src/App.tsx (any change that triggers a hot reload throws an error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants