0

I'm working with Tauri, using React and Vite for the front end. Everything was going well, but recently after changing some things around in this monorepo vite runs into a bug where it attempts to build, somehow launches another instance of itself somewhere, I think, and then fails because the port is already in use.

Maybe I'm reading too much into this, but it keeps colliding with it's own port, and if I set the server.strictPort field to false, it just goes 1420, 1421, 1422, 1423... and fails on every port.

I am absolutely positive I have nothing running on these ports before trying to build this app, and everything was great until I made some modifications to the monorepo itself, like integrating eslint and moving some common ui components to a separate package.

I had a bad habit of using next for more than I should have, but I'm not completely new at setting up a typescript library but for the life of me I can't figure this out.

I know this is a vite issue as the build fails with the same output, regardless of whether it's run as part of tauri or by call vite directly.

This is the output with the strictPort value set to true, which it needs to be for tauri to work, but if I set that to false this just prints continually in a loop of sequential ports.

error when starting dev server:
Error: Port 1420 is already in use
    at Server.onError (file:///Users/bigsexy/Desktop/fluster/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:25023:18)
    at Server.emit (node:events:507:28)
    at emitErrorNT (node:net:1973:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
 ELIFECYCLE  Command failed with exit code 1.
       Error The "beforeDevCommand" terminated with a non-zero status code.

Any help is greatly appreciated.

2
  • That’s not going to go anywhere without minimal reproducible example :(. Sadly saying I have changed something in a monorepo and now it all broken, only gonna produce more questions, witch monorepo, what’s the setup, dependencies? How you build your packages… Likely there issue with one of your packages in there… that’s probably about what it’s possible to say… Commented May 26 at 22:31
  • Yep that's a very common vite issue. IIRC it's related to lsp interacting, I usually restart my editor and it works fine again Commented Jun 13 at 10:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.