jonluca / vite-typescript-ssr-react

🚀 A Vite Typescript SSR React boilerplate!
https://blog.jonlu.ca/posts/vite
345 stars 48 forks source link

Crash on start yarn dev:server #13

Closed GimpMaster closed 1 year ago

GimpMaster commented 1 year ago
➜  vite-typescript-ssr-react git:(master) yarn dev:server
yarn run v1.22.19
$ nodemon --watch server.ts --watch src/server --exec 'ts-node server.ts'
[nodemon] 2.0.20
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): server.ts src/server/**/*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `ts-node server.ts`
App is listening on http://localhost:7456
[Error: ENOENT: no such file or directory, scandir '/home/dev/test/vite-typescript-ssr-react/dist/assets'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/home/dev/test/vite-typescript-ssr-react/dist/assets'
}

I'm guessing you have to build first to create the dist/assets folder?

GimpMaster commented 1 year ago

Doing a build does solve the issue. You might want to update docs. Thanks for the example project!

jonluca commented 1 year ago

You're right, this is a bug, just pushed a fix so that it won't crash if you run dev server without a build.