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: error in pnpm monorepo when using default entries #7722

Closed
1 task done
itsMapleLeaf opened this issue Oct 21, 2023 · 7 comments
Closed
1 task done

Vite: error in pnpm monorepo when using default entries #7722

itsMapleLeaf opened this issue Oct 21, 2023 · 7 comments
Assignees
Labels
bug Something isn't working pm:pnpm Bugs related to pnpm vite

Comments

@itsMapleLeaf
Copy link
Contributor

What version of Remix are you using?

0.0.0-experimental-5603af8a3

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

git clone -b default-entries https://github.com/itsMapleLeaf/remix-vite-workspaces.git
cd remix-vite-workspaces
pnpm install
cd workspaces/web
pnpm dev

Expected Behavior

The app should run without errors

Actual Behavior

You get an error in the browser that it can't find the default entry files outside of the root workspace:

Cannot resolve asset path "C:\dev\demo\remix-vite-workspaces\node_modules\.pnpm\@remix-run+dev@0.0.0-experimental-5603af8a3_@remix-run+serve@0.0.0-experimental-5603af8a3_typescript@5.2.2_vite@4.5.0\node_modules\@remix-run\dev\dist\config\defaults\entry.server.node.tsx" outside of root directory "C:\dev\demo\remix-vite-workspaces\workspaces\web".
    at resolveFileUrl (C:\dev\demo\remix-vite-workspaces\node_modules\.pnpm\@remix-run+dev@0.0.0-experimental-5603af8a3_@remix-run+serve@0.0.0-experimental-5603af8a3_typescript@5.2.2_vite@4.5.0\node_modules\@remix-run\dev\dist\vite\plugin.js:74:11)
    at getServerEntry (C:\dev\demo\remix-vite-workspaces\node_modules\.pnpm\@remix-run+dev@0.0.0-experimental-5603af8a3_@remix-run+serve@0.0.0-experimental-5603af8a3_typescript@5.2.2_vite@4.5.0\node_modules\@remix-run\dev\dist\vite\plugin.js:194:51)
    at async Context.load (C:\dev\demo\remix-vite-workspaces\node_modules\.pnpm\@remix-run+dev@0.0.0-experimental-5603af8a3_@remix-run+serve@0.0.0-experimental-5603af8a3_typescript@5.2.2_vite@4.5.0\node_modules\@remix-run\dev\dist\vite\plugin.js:411:20)
    at async Object.load (file:///C:/dev/demo/remix-vite-workspaces/node_modules/.pnpm/vite@4.5.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44323:32)
    at async loadAndTransform (file:///C:/dev/demo/remix-vite-workspaces/node_modules/.pnpm/vite@4.5.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:54954:24)

Workaround: run pnpm remix reveal in the workspace to create default entries

itsMapleLeaf added a commit to itsMapleLeaf/remix-vite-workspaces that referenced this issue Oct 21, 2023
@brophdawg11 brophdawg11 added the pm:pnpm Bugs related to pnpm label Oct 23, 2023
@pcattori pcattori added vite bug Something isn't working and removed bug:unverified labels Oct 27, 2023
@pcattori
Copy link
Contributor

Yep, this check is probably to aggressive. Looking into it

@markdalgleish
Copy link
Member

This should be fixed by #7913.

@vanvix
Copy link

vanvix commented Nov 14, 2023

Hello, this issue is present on Windows, tested again today in nightly version and still doesn't work. Tested on MacOS and works just fine.

Here's link to the original comment: #7960 (comment)

Basicaly, solution for this is to run npx remix reveal in the workpace directory you can't run and 2 new .entry files will appear. I'm leaving the comment here suggested by @mrksbnch.

@alindsay55661
Copy link

I ran into a different error but the workarounds here resulted in a fix. In my case, the app simply wouldn't start properly:

image

Using pnpm remix reveal solved the issue. You can see I'm uinsg Windows as well.

@hi-ogawa
Copy link
Contributor

hi-ogawa commented Nov 20, 2023

Could someone test this patch on Windows? #8057
I'm hoping that this could fix this issue by changing from /@fsC:\Users\... to /@fs/C:/Users/..., but currently I cannot find a way to verify this change on CI or local since I don't have Windows PC.

@alindsay55661
Copy link

@hi-ogawa I can confirm that your patch solves my specific problem on Windows.

@pcattori pcattori removed this from the Stabilize Vite milestone Nov 21, 2023
@pcattori
Copy link
Contributor

Windows issues should be fixed by #8057 . You can try it out on nightly starting tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pm:pnpm Bugs related to pnpm vite
Projects
None yet
Development

No branches or pull requests

7 participants