question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: ENOENT: no such file or directory, scandir '/Users/alejandro/code/fun/remix-quickstart/server/posts'

See original GitHub issue

Which Remix packages are impacted?

  • remix (Remix core)
  • create-remix
  • @remix-run/architect
  • @remix-run/cloudflare-workers
  • @remix-run/dev
  • @remix-run/express
  • @remix-run/netlify
  • @remix-run/node
  • @remix-run/react
  • @remix-run/serve
  • @remix-run/server-runtime
  • @remix-run/vercel

What version of Remix are you using?

^1.0.3

Steps to Reproduce

In the developer blog tutorial:

  1. This section https://remix.run/docs/en/v1/tutorials/blog#dynamic-route-params
  2. This step 💿 Add a getPost function to our post module Put this function anywhere in the app/post.ts module:

When I copy that code in my example, and I go to http://localhost:3000/posts I got this error

ENOENT: no such file or directory, scandir '/Users/alejandro/code/fun/remix-quickstart/server/posts'

Expected Behavior

  • I’d expect /posts not to be broken.
  • I’d expect /posts/:slug not to be broken

Actual Behavior

Whenever I visit /posts/ or /posts/:slug, I get the error I mentioned above. I already tried using Vercel and Remix Server, but I got the same result.

Am I missing something?

FWIW I’m using Node 14.x

Seems to be related to https://github.com/remix-run/remix/issues/448

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ryanflorencecommented, Nov 24, 2021

The tutorial makes it more clear you should use the remix app server now, the file system stuff is relative to the output directory, not the source, go back one more directory since you’re actually in “server/posts/{server-output-file}.js”

I’ll go update it to add this note inline with the file system reading

0reactions
Adbibcommented, Jan 23, 2022

Work on local dev but still broken on vercel production 😕

if you can please share with us your structure and some shots from your code

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: ENOENT: no such file or directory, scandir
I got the error 'Error: ENOENT: no such file or directory, scandir '**/node_modules/node-sass/vendor', this solution helped me resolve it.
Read more >
ENOENT: no such file or directory, scandir · Issue #901 - GitHub
Bundling with esbuild causes the error above to crash the application. Possible causes: bullmq/src/classes/redis-connection.ts. Line 122 in ...
Read more >
Error: ENOENT: no such file or directory, scandir - Issues/Bugs ...
... Version: 4.5.2 Summary: I'm getting the error Encountered internal error running command: Error: ENOENT: dos such file or directory, scandir '/User/[Use…
Read more >
Error: ENOENT: no such file or directory, scandir ... - YouTube
nodejsError: ENOENT : no such file or directory, scandir '**/node_modules/node-sass/vendor' | Module build failed (from .
Read more >
Fix "no such file or directory, scandir" - David Walsh Blog
One recent error I ran into was from a dependency of a dependency: ... throw err; ^ Error: ENOENT: no such file or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found