You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ./src/entries/server.js file just starts an express server:
importappfrom'../lib/app'importenvfrom'../lib/env'app.listen(env.APP_PORT,function(){console.log(`app listening on http://localhost:${env.APP_PORT}`)})
Ideally I would like HMR to work with this as well. Perhaps I am doing this the wrong way, but right now, when I run the dev command and edit a file, vite-node gives the following error:
[vite-node] Failed to execute file: Error: listen EADDRINUSE: address already in use :::5000 at Server.setupListenHandle [as _listen2] (node:net:1468:16) at listenInCluster (node:net:1516:12) at Server.listen (node:net:1604:7) at Function.listen (/Users/dionsaur84/Sites/dio-framework/node_modules/express/lib/application.js:635:24) at /Users/dionsaur84/Sites/dio-framework/src/entries/server.js:10:5 at ViteNodeRunner.directRequest (file:///Users/dionsaur84/Sites/dio-framework/node_modules/vite-node/dist/client.mjs:289:5) at ViteNodeRunner.cachedRequest (file:///Users/dionsaur84/Sites/dio-framework/node_modules/vite-node/dist/client.mjs:149:14) at ViteNodeRunner.executeFile (file:///Users/dionsaur84/Sites/dio-framework/node_modules/vite-node/dist/client.mjs:126:12) at CAC.run (file:///Users/dionsaur84/Sites/dio-framework/node_modules/vite-node/dist/cli.mjs:678:5) { code: 'EADDRINUSE', errno: -48, syscall: 'listen', address: '::', port: 5000}
Describe the bug
I'm trying to use vite for frontend and vite-node for backend
In dev, I would like:
For example, here is my
dev
script inside ofpackage.json
:Here is my
vite.config.js
file:The
./src/entries/server.js
file just starts an express server:Ideally I would like HMR to work with this as well. Perhaps I am doing this the wrong way, but right now, when I run the dev command and edit a file,
vite-node
gives the following error:Reproduction
Please see description.
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: