how to solve the script has an unsupported MIME type (‘text/html’)?
I get this: Service Worker URL: /mockServiceWorker.js index.tsx:33
Failed to start mock service worker: DOMException: Failed to update a
ServiceWorker for scope (‘http://localhost:3000/’) with script
(‘http://localhost:3000/mockServiceWorker.js’): The script has an
unsupported MIME type (‘text/html’). (anonymous) @ index.tsx:33
Promise.catch (async) ./src/index.tsx @ index.tsx:31 options.factory @
react refresh:6
webpack_require @ bootstrap:22 (anonymous) @ startup:7 (anonymous) @ startup:7 createGlobalStyle.ts:40 Please do not use @import CSS
syntax in createGlobalStyle at this time, as the CSSOM APIs we use in
production do not handle it well. Instead, we recommend using a
library such as react-helmet to inject a typical meta tag to
the stylesheet, or simply embedding it manually in your index.html
my project failed to register the Service Worker while adopting mocks with MSW on local and ghpages, any clues?
My folder structure:
my project failed to register the Service Worker while adopting mocks with MSW on local and ghpages, any clues?
My folder structure: