Replies: 1 comment
-
Hi, @jrock2004. Yes, this is certainly a worker configuration. The requirement is to serve the worker script at the same level or higher than the application it should control. If you do serve the script under The message you see in the console implies that you are viewing a page outside of the worker's scope. This may happen if you serve the Storybook at some nested path but you view Storybook at the root. If that's the case, please follow one of those suggestions from the message, they are useful. Alternatively, you can use the One common issue is that people forget to deploy the worker script. That's fixed by including the public directory where you serve the worker as the |
Beta Was this translation helpful? Give feedback.
-
So what I want to do is use MSW in my storybook and it works just fine when running locally. The issue I have is when we deploy this out the url it gets deployed to is,
https://mydomain.com/storybooks/myapplication/index.html
. When I go to the URL I get the following in the browser:I even tried when initiating the worker to update it to something like
If I go to
https://mydomain.com/storybooks/myapplication/mockServiceWorker.js
it loads it just fine. I do see in the consoleBut that seems to be a server configuration. Is there a way in my code to set this to work? I am guessing this is more a service worker thing than an MSW thing
Beta Was this translation helpful? Give feedback.
All reactions