chrome-extension-tools
chrome-extension-tools copied to clipboard
When import yarn pnp virtual module, file is not found in dev mode
Build tool
Vite
Where do you see the problem?
- [X] In the browser
- [ ] In the terminal
Describe the bug
I'm using yarn pnp monorepo.
when use peerdeps in workspaces, yarn makes virtual package. and this makes unexpected builds result in dev mode
import { A } from 'somepackage';
import { A } from '../../Users/somepath/.yarn/__virtual__/some-package-virtual-asdfasdf/~/dist/index.js';
in this case chrome show FILE NOTFOUND err because dist doesn't have yarn virtual files.
Reproduction
in yarn pnp monorepo wokspace,
repo
- packages/a
- packages/b
- extension-app
dependency B -> A (peerDeps) App -> B
and import B in contentScript.
Logs
No response
System Info
System:
OS: macOS 12.6.3
CPU: (10) arm64 Apple M1 Max
Memory: 16.89 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.14.0 - ~/.nvm/versions/node/v18.14.0/bin/node
Yarn: 3.6.1 - ~/.nvm/versions/node/v18.14.0/bin/yarn
npm: 9.3.1 - ~/.nvm/versions/node/v18.14.0/bin/npm
Browsers:
Chrome: 115.0.5790.170
Edge: 114.0.1823.67
Safari: 16.5.1
Severity
blocking all usage of RPCE