-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENOENT Error when importing node_modules from network drive #5010
Comments
I'm getting the same issue. What is occuring is that the hostname is getting prepended to the path of the depency rather than the drive letter. instead of:
output is: this is what is generating the code: vite/packages/vite/src/node/optimizer/index.ts Lines 236 to 253 in b582581
The issue could be coming from the result of this regex: vite/packages/vite/src/node/utils.ts Lines 34 to 35 in b582581
|
I can confirm the same prepended behavior and possible trigger. Project creation
Then in main.js add:import {Map, View} from './node_modules/ol'; // trigger the error Then in buildBOOM! Possible TriggerIn my case when node_modules\ol\layer\BaseVector.js trys to import rbush (line 20) things start to blow up: import Layer from './Layer.js';
import RBush from 'rbush';
import { assign } from '../obj.js'; So esbuild (I think) tries to look for rbush. Interestingly, the dir rbush is in node_modules Serve does not throw the errorI think serve uses rollup and might do the traditional node_modules walk up the directory tree then find rbush Many modules do get transformedSome non-vitejs file are transformed from the ol package, however, when ol says it needs rbush and rbush says it needs quickselect things go of the rails. Compare the path to the ones in Mapped drive paths ✓ 157 modules transformed. Mapped drive pathspublicDir: 'Z:\var\gist\7132\wksp_web\test_vite_06\public' I hope this helps. |
Also been facing this issue for ages before finally figuring out the cause. Was trying to use Vite with Inertia for Laravel and receiving errors like the following:
Turns out it was due to the fact I had set up the project under |
You have to enable the
|
This works with me on vite, vue3, superb. |
I think using |
Describe the bug
What's the problem?
When creating a vite project on a network drive, any import from a node modules (that is not a dependency of vite) will throw an "Error: ENOENT: no such file or directory" Error.
It happens with a minimal vite setup without another framework, as well as on a vite-react project
Here is the Error message:
Error: ENOENT: no such file or directory, open '/192.168.19.11/Ausgabe_Files/Github/three-tools/three-testing/node_modules/react/index.js' at Object.openSync (fs.js:476:3) at Object.readFileSync (fs.js:377:35) at optimizeDeps (C:\Users\360ty\AppData\Roaming\nvm\v14.16.1\node_modules\vite\dist\node\chunks\dep-36bf480c.js:71704:42) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async runOptimize (C:\Users\360ty\AppData\Roaming\nvm\v14.16.1\node_modules\vite\dist\node\chunks\dep-36bf480c.js:75494:48) at async Server.httpServer.listen (C:\Users\360ty\AppData\Roaming\nvm\v14.16.1\node_modules\vite\dist\node\chunks\dep-36bf480c.js:75510:21)
Reproduction
npm init vite@latest <project-name>
)npm i
to install dependenciesnow try doing the same thing on a local disk and it'll work just fine
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: