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

Remix Vite cannot run with pnpm on Windows #8117

Closed
hyunrealshadow opened this issue Nov 23, 2023 · 4 comments
Closed

Remix Vite cannot run with pnpm on Windows #8117

hyunrealshadow opened this issue Nov 23, 2023 · 4 comments

Comments

@hyunrealshadow
Copy link

Reproduction

Clone this repo, then run pnpm i.
Finally, execute pnpm run build in the workspace package.

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
    Memory: 41.94 GB / 79.93 GB
  Binaries:
    Node: 18.12.1 - ~\scoop\apps\volta\current\appdata\tools\image\node\18.12.1\node.EXE
    Yarn: 1.22.18 - ~\scoop\apps\volta\current\appdata\tools\image\yarn\1.22.18\bin\yarn.CMD
    npm: 9.6.1 - ~\scoop\apps\volta\current\appdata\tools\image\npm\9.6.1\bin\npm.CMD
    pnpm: 8.9.0 - ~\scoop\apps\volta\current\appdata\bin\pnpm.EXE
  Browsers:
    Edge: Chromium (119.0.2151.72)
    Internet Explorer: 11.0.22621.1

Used Package Manager

pnpm

Expected Behavior

The project can be built successfully.

Actual Behavior

After executing the command, an error is triggered.

[vite]: Rollup failed to resolve import "/@fsE:\project\node_modules\.pnpm\@[email protected][email protected][email protected]\node_modules\@remix-run\dev\dist\config\defaults\entry.server.node.tsx" from "virtual:server-entry".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
error during build:
Error: [vite]: Rollup failed to resolve import "/@fsE:\project\node_modules\.pnpm\@[email protected][email protected][email protected]\node_modules\@remix-run\dev\dist\config\defaults\entry.server.node.tsx" from "virtual:server-entry".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

After debugging, I temporarily modified the code in node_modules.
I edited the file

if (!isWithinRoot) return `/@fs` + filePath;
and added / after @fs, which resolved the issue for me.

@AlemTuzlak
Copy link
Contributor

AlemTuzlak commented Nov 23, 2023

@pcattori This is the same error I got that you told me to create an issue on the repo about in discord. You can also reproduce this in Remix Dev Tools:
https://github.com/Code-Forge-Net/Remix-Dev-Tools

  • clone the repo
  • npm install
  • npm run build
  • npm run dev:vite

I get the same error, but it's not pnpm related, but rather monorepo/windows issue? I'd assume?

Here is my error log, as you can see, it also starts with "fs" :

Failed to load url "/@fsC:\Users\Alem Tuzlak\projects\Remix-Dev-Tools\node_modules@remix-run\dev\dist\config\defaults\entry.server.node.tsx (resolved id: /@fsC:\Users\Alem Tuzlak\projects\Remix-Dev-Tools\node_modules@remix-run\dev\dist\config\defaults\entry.server.node.tsx) in virtual:server-entry. Does the file exist?

Also I've noticed that it goes away IF I remove my rdt vite plugin, but the plugin itself does nothing to make this error happen, I just add some imports inside of root.tsx, I don't mess with the existing codebase

@hi-ogawa
Copy link
Contributor

I think this is a duplicate of #7722 (comment)
This is supposed to be fixed by #8057 but it seems it was not included in v2.3.1 (even though the bot said it's in v2.3.1-pre.1 #8057 (comment)).
Could you try nightly?

@hyunrealshadow
Copy link
Author

hyunrealshadow commented Nov 23, 2023

I think this is a duplicate of #7722 (comment) This is supposed to be fixed by #8057 but it seems it was not included in v2.3.1 (even though the bot said it's in v2.3.1-pre.1 #8057 (comment)). Could you try nightly?

I tried the version @remix-run/dev 0.0.0-nightly-6953c3f-20231123 and it worked for me
Thank You @hi-ogawa

@AlemTuzlak
Copy link
Contributor

@hi-ogawa also can confirm it works now, sweet, this will speed up my remix dev tools vite plugin development by a ton!

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

4 participants