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

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

Closed
rahXephonz opened this issue Aug 8, 2022 · 8 comments
Closed

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

rahXephonz opened this issue Aug 8, 2022 · 8 comments

Comments

@rahXephonz
Copy link

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
Copy link
Author

Seems like on vite configuration, isn't it?

@rahXephonz
Copy link
Author

storybookjs/builder-vite#452 i've got the reference from others

@rahXephonz
Copy link
Author

And this one too vitejs/vite#9113 related with vite 3

@jonluca
Copy link
Owner

jonluca commented Aug 8, 2022

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

@rahXephonz
Copy link
Author

rahXephonz commented Aug 8, 2022

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
Copy link
Author

rahXephonz commented Aug 8, 2022

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
Copy link
Author

rahXephonz commented Aug 8, 2022

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 rahXephonz reopened this Aug 8, 2022
@rahXephonz rahXephonz changed the title [Bug] Cannot find module 'node:path' when running the server and client [Bug] [Error: ENOENT: no such file or directory, scandir] Aug 8, 2022
@rahXephonz
Copy link
Author

oops sorry, my bad. just some typo in here

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

2 participants