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

dev-server does not restarts when it crashes #690

Closed
fredericrous opened this issue Apr 7, 2024 · 3 comments
Closed

dev-server does not restarts when it crashes #690

fredericrous opened this issue Apr 7, 2024 · 3 comments

Comments

@fredericrous
Copy link
Contributor

fredericrous commented Apr 7, 2024

I'm using a monorepo with pnpm. My Epic Stack project has a dependency on another workspace

  // package.json
  "my-react-lib": "workspace:*"

when my-react-lib gets rebuilt, the built artefact gets removed for a sec and the new one replaces it

when this happens, dev-server crashes with an error that looks something like

[vite] Error when evaluating SSR module virtual:remix/server-build: failed to import "app/routes/my-page.tsx"
Error: Failed to load url /@fs/monorepo/my-project/dist/my-react-lib.js (resolved id:  /@fs/monorepo/my-project/dist/my-react-lib.js ) in  /@fs/monorepo/my-epic-stack-project/app/routes/my-page.tsx. Does the file exist?
    at loadAndTransform (file:///monorepo/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-G-px366b.js:53634:21)
    at instantiateModule (file:///monorepo/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-G-px366b.js:54656:10)

By it crashes, I mean, when I reload the browser to show my-page, chrome says This site can’t be reached ERR_CONNECTION_REFUSED

workaround: restart the dev-server manually: Ctrl+C, and then npm run dev

I tried to fix this issue by myself but all my attempts have failed so far

@koikar
Copy link

koikar commented Apr 12, 2024

I am experiencing similar issues with syntax errors. While editing files and using the vs-code autosave feature, my dev server constantly crashes.

[vite] Internal server error: Transform failed with 1 error

I am wondering if there is a better solution than just turning off the autosave feature. Has anyone found a solution?

@simonszalai
Copy link

It's the same issue as #638, there is a pretty decent solution written there. It's not 100%, but it can work.

@kentcdodds
Copy link
Member

Closing this in favor of #638

agcty added a commit to agcty/epic-stack that referenced this issue Sep 4, 2024
@agcty agcty mentioned this issue Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants