Open wighawag opened 2 years ago
There's a request to http://localhost:5173/node_modules/.vite/deps/@ethersproject_bignumber.js?v=d8f06203 but there isn't any request to http://localhost:5173/node_modules/.pnpm/@ethersproject+bignumber@5.7.0/node_modules/@ethersproject/bignumber/src.ts/bignumber.ts.
Would you exlpain how you set the breakpoint with screenshot?
HI @sapphi-red here is a screenshost
In my case, the way I worked around this was by cloning the (two levels nested) dependency's source, building it locally and finally linking it.
Clone dependency:
git clone https://github.com/libp2p/js-libp2p-websockets.git
Install, build and link dependency:
yarn install
yarn run build
yarn link
Link dependency where imported:
yarn link "@libp2p/websockets"
Reinstall/remove cached dependencies in the project vite
serves:
rm -rf node_modules/.vite
or
rm -rf node_modules
yarn install
Error (for future lookup): Could not load content for http://localhost:5174/node_modules/<path-to-file>.ts (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)
My workaround is to copy the node_modules folder in the dist folder after vite dev is executed
But of course we want it work out of the box :)
Any news for this issue?
+1 to this issue; my workaround was to temporarily go back to npm while debugging
Describe the bug
When I use @ethersproject/ethers (https://github.com/ethers-io/ethers.js) in my vite project I get source mapping issues when debugging in browser.
In a monorepo setup it cannot even find the files and I get error like
in a simple folder setup, the lines are offf
I created 2 repo to reproduce the issue
monorepo : https://github.com/bug-reproduction/vite-ethers-monorepo simple folder: https://github.com/bug-reproduction/vite-ethers
The setup is using vite svelte-ts template
Reproduction
https://github.com/bug-reproduction/vite-ethers-monorepo
Steps to reproduce
System Info
Used Package Manager
pnpm
Logs
No response
Validations