jonluca / vite-typescript-ssr-react

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

[Bug] [Error: ENOENT: no such file or directory, scandir] #10

Closed rahXephonz closed 2 years ago

rahXephonz commented 2 years ago

Hello, i hope you are good. I want to try improve this project with research about ssr, I like this template

But got some issues when running the server or client. You can see at this screenshot

Screenshot 2022-08-08 at 11 10 54

How the solve this issue? I'm using node engine 14.17.0

rahXephonz commented 2 years ago

Seems like on vite configuration, isn't it?

rahXephonz commented 2 years ago

https://github.com/storybookjs/builder-vite/issues/452 i've got the reference from others

rahXephonz commented 2 years ago

And this one too https://github.com/vitejs/vite/issues/9113 related with vite 3

jonluca commented 2 years ago

Hello, you might not be on a version of node that's new enough. Can you try node 18?

rahXephonz commented 2 years ago

Hello, you might not be on a version of node that's new enough. Can you try node 18?

yeah i can, yep that a first solution, but how about another solution that we dont want upgrade the versions about this? So you are using node v18?

rahXephonz commented 2 years ago

hmm, read a lot reference and mention about this issue on vite there are no solutions other upgrading the node version

Someone tell this before

Vite uses node: import which is supported in v16.0.0+ and v14.18.0+. v15 does not support this. https://nodejs.org/api/esm.html#node-imports

rahXephonz commented 2 years ago

Hello @jonluca i've upgraded my node engine but got this issue when running server with yarn dev:server

App is listening on http://localhost:7456
[Error: ENOENT: no such file or directory, scandir '/Users/macbook/Desktop/vite-ssr/dist/assets'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/Users/macbook/Desktop/vite-ssr/dist/assets'
}
[nodemon] app crashed - waiting for file changes before starting...
rahXephonz commented 2 years ago

oops sorry, my bad. just some typo in here