I try to use MSW with '@web/dev-server' and always get a
Uncaught SyntaxError: import not found: getCleanUrl
coming form http://localhost:8000/node_modules/msw/lib/esm/RequestHandler-deps.js
The most minimal example I can come up is:
<script type="module">
import { setupWorker, rest } from 'msw';
window.onload = function () {
const worker = setupWorker(
rest.get('/test', (req, res, ctx) => {
return res(
ctx.json({
value: 'test',
})
)
}),
)
worker.start();
}
</script>
inside the index.html
The thing is, I can see getCleanUrl inside the browser debugger when I navigate inside the node_modules folder to it.
Also the mockServiceWorker.js is set correctly on the root, I can navigate to it via http://localhost:8000/mockServiceWorker.js
So I am very confused why the browser complains about not finding it..