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

do not reset handlers if msw is not defined for story, fix #25 #79

Closed
wants to merge 1 commit into from

Conversation

gazs
Copy link

@gazs gazs commented Mar 31, 2022

Fixes #25

Ensuring that api.resetHandlers() is only called if msw is defined as a parameter of a story solves the issue where if any loaded story file didn't have an msw parameter defined the browser window would hang.

While this solves the issue in my storybook, I am not sure if it can have any unintended effects, please let me know!

@vercel
Copy link

vercel bot commented Mar 31, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mswjs/msw-storybook-addon/GM8Hxc57cmqR4LdARhQMh5n7dy4f
✅ Preview: https://msw-storybook-addon-git-fork-gazs-fix-issue-25-freezing-mswjs.vercel.app

@gazs
Copy link
Author

gazs commented Mar 31, 2022

Turns out this was not the root cause in the end, but rather a conflicting storybook addon.

@corbinschwartz
Copy link

@gazs which storybook addon was conflicting?

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 this pull request may close these issues.

Storybook may freeze when switching to a story that sends requests but does not define any routes.
2 participants