Open dlvhdr opened 1 month ago
Hi. Do you have msw
installed? What does npm ls msw
print?
Yes, I have it installed. I'm using yarn v1:
$ yarn why msw
yarn why v1.22.22
[1/4] 🤔 Why do we have the module "msw"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "msw@2.0.3"
info Reasons this module exists
- "_project_#web" depends on it
- Hoisted from "_project_#web#msw"
✨ Done in 1.01s.
But npm also finds it:
$ npm ls msw
mono@ /Users/dlvhdr/code/komodor/mono
└─┬ web@0.1.0 -> ./services/web
└── msw@2.0.3
Description
I tried using this library but couldn't make it work.
source
with our browser handlersCould not resolve "msw"
Reproduction steps
@modyfi/vite-plugin-yaml
to load open api specs in YAML:import spec from "./swagger.yaml";
export const testHandlers = await fromOpenApi(JSON.stringify(spec));
vite
Get error
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating ✘ [ERROR] Could not resolve "msw"
You can mark the path "msw" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
/Users/dlvhdr/code/komodor/mono/node_modules/esbuild/lib/main.js:1472 let error = new Error(text); ^
Error: Build failed with 1 error: ../../node_modules/@mswjs/source/lib/open-api/from-open-api.js:1:34: ERROR: Could not resolve "msw" at failureErrorWithLog (/Users/dlvhdr/code/komodor/mono/node_modules/esbuild/lib/main.js:1472:15) at /Users/dlvhdr/code/komodor/mono/node_modules/esbuild/lib/main.js:945:25 at /Users/dlvhdr/code/komodor/mono/node_modules/esbuild/lib/main.js:1353:9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { errors: [Getter/Setter], warnings: [Getter/Setter] }
Node.js v18.18.2 error Command failed with exit code 1.