Skip to content
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

Vite processes stuck when using @rollup/plugin-node-resolve on Windows VMs #19430

Closed
7 tasks done
stephenlrandall opened this issue Feb 14, 2025 · 1 comment
Closed
7 tasks done

Comments

@stephenlrandall
Copy link
Contributor

Describe the bug

I typically develop on macOS, and have been working on an app that looks something like this reproduction: https://github.com/stephenlrandall/vite-resolve-test.

The heart of the issue seems to come from components stored outside the root of the project, but that wish to reference dependencies stored in the project. For example, this component references mathjs, which is in the main app/node_modules. This component is referenced through the $external alias. Normally, Vite wouldn't be able to resolve the import in Component.svelte, but with @rollup/plugin-node-resolve I can add a plugin to Vite that allows it to correctly resolve the import:

plugins: [
    sveltekit(),
+   nodeResolve({ modulePaths: [path.resolve('./node_modules')] })
],

This all works fine, until I move to Windows. (It actually also seems to work on normal Windows systems, but not on Windows VMs.) At this point I run into hanging processes for both dev and build. (See attached logs.) I've found similar issues across the internet (the most active was https://community.cloudflare.com/t/vite-stuck-in-build/696830, although that seems like a different case and more reliably reproducible).

Reproduction

https://github.com/stephenlrandall/vite-resolve-test

Steps to reproduce

From the app/ folder, install the dependencies and try running either npm run dev or npm run build.

System Info

From the VM on which the processes hang:

  System:
    OS: Windows 10 10.0.19045
    CPU: (6) x64 Intel(R) Xeon(R) Gold 6226R CPU @ 2.90GHz
    Memory: 5.03 GB / 12.00 GB
  Binaries:
    Node: 20.17.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 10.3.0 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.146)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    vite: ^6.0.0 => 6.1.0

Used Package Manager

npm

Logs

During dev
10:36:23 AM [vite] (ssr) Error when evaluating SSR module /src/routes/+page.svelte: transport invoke timed out after 60000ms (data: {"type":"custom","event":"vite:invoke","data":{"name":"fetchModule","id":"send:2A9qbBL8__gx3kfn3ueOG","data":["/@fs/C:/Users/randasl1/Documents/vite-resolve-test/external/Component.svelte","C:/Users/randasl1/Documents/vite-resolve-test/app/src/routes/+page.svelte",{"cached":false,"startOffset":2}]}})
      at reviveInvokeError (file:///C:/Users/randasl1/Documents/vite-resolve-test/app/node_modules/vite/dist/node/module-runner.js:537:17)
      at Object.invoke (file:///C:/Users/randasl1/Documents/vite-resolve-test/app/node_modules/vite/dist/node/module-runner.js:624:15)
      at async SSRCompatModuleRunner.getModuleInformation (file:///C:/Users/randasl1/Documents/vite-resolve-test/app/node_modules/vite/dist/node/module-runner.js:1192:73)
      at async request (file:///C:/Users/randasl1/Documents/vite-resolve-test/app/node_modules/vite/dist/node/module-runner.js:1214:88)
      at async eval (C:/Users/randasl1/Documents/vite-resolve-test/app/src/routes/+page.svelte:3:153)
      at async ESModulesEvaluator.runInlinedModule (file:///C:/Users/randasl1/Documents/vite-resolve-test/app/node_modules/vite/dist/node/module-runner.js:1049:5)
      at async SSRCompatModuleRunner.directRequest (file:///C:/Users/randasl1/Documents/vite-resolve-test/app/node_modules/vite/dist/node/module-runner.js:1271:61)
      at async SSRCompatModuleRunner.directRequest (file:///C:/Users/randasl1/Documents/vite-resolve-test/app/node_modules/vite/dist/node/chunks/dep-CfG9u7Cn.js:30895:23)
During build
$ npm run build

> [email protected] build
> vite build     

vite v6.1.0 building SSR bundle for production...
transforming (156) node_modules\svelte\src\internal\client\loop.js

(The exact display line changes each time, but it's getting stuck right at the end of the transformation process.)

Validations

@sapphi-red
Copy link
Member

It seems this await does not resolve.
https://github.com/rollup/plugins/blob/94951774773a8797ff7e1a93d0a7ebf14f009327/packages/node-resolve/src/resolveImportSpecifiers.js#L293-L308

Please report to rollup/plugins as this doesn't seem to be a bug in Vite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants