ERR_MODULE_NOT_FOUND when trying to run Vite inside a Docker container #20372
-
Describe the bugI'm migrating my website to Vite & React. My website uses Docker for containerization. But when i try to use Vite in my container (
Note that What i've tried
Reproductionsee reproduction steps Steps to reproduce
System InfoSystem:
OS: macOS 26.0
CPU: (10) arm64 Apple M4
Memory: 116.91 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.19.3 - ~/.nvm/versions/node/v20.19.3/bin/node
Yarn: 1.22.22 - /opt/homebrew/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v20.19.3/bin/npm
Browsers:
Chrome: 138.0.7204.93
Safari: 26.0
npmPackages:
@vitejs/plugin-react: ^4.5.2 => 4.6.0
vite: ^7.0.0 => 7.0.2 Used Package Managernpm LogsNo response Validations
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
It looks like you are running |
Beta Was this translation helpful? Give feedback.
Ok the issue was that i've mounted node_modules from a different environment. I removed the volume mount and ran
npm ci
in the container and it worked.