[Bug]: Blog Quickstart Netlify: ENOENT: no such file or directory, scandir '/Users/Dev/remix-quick-start-blog/netlify/functions/server/posts'
See original GitHub issueWhich 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
Follow the quick start blog guide (and configure site with Netlify) up to this step https://remix.run/docs/en/dev/tutorials/blog#pulling-from-a-data-source that requires let postsPath = path.join(__dirname, "../posts"); to be added to get the posts.
Navigate to localhost:3000/posts and see the error message ENOENT: no such file or directory, scandir 'remix-quick-start-blog/netlify/functions/server/posts'.
Expected Behavior
Following the tutorial’s instructions of:
💿 Create a "posts/" folder in the root of the project, not in the app directory, but next to it.
mkdir posts
Now add some posts:
touch posts/my-first-post.md
touch posts/90s-mixtape.md
will result in navigating to http://localhost:3000/posts displaying a list of the posts
Actual Behavior
Following the tutorial’s instructions of:
💿 Create a "posts/" folder in the root of the project, not in the app directory, but next to it.
mkdir posts
Now add some posts:
touch posts/my-first-post.md
touch posts/90s-mixtape.md
will result in navigating to http://localhost:3000/posts displays an error message ENOENT: no such file or directory, scandir 'remix-quick-start-blog/netlify/functions/server/posts'. unless the posts folder is moved into the netlify/functions/server folder.
Additional Information
Moving the posts folder into netlify/functions/server resolved the issue for me but the tutorials says to put the posts in the root directory. Is the expected functionality that users should put the posts in the netlify/functions/ folder in order for the project to work as expected? If so, can the tutorial documents be updated? If not, is additional configuration required for Netlify? I opened a PR related to Netlify needing additional setup for the quick start tutorial https://github.com/remix-run/remix/pull/446
I see the Jokes App tutorial mentions:
Remix can be deployed in a large and growing list of JavaScript environments. The “Remix App Server” is a full-featured Node.js server based on Express. It’s the simplest option and it satisfies most people’s needs, so that’s what we’re going with for this tutorial. Feel free to experiment in the future!
Instead of adding instructions for specific deployment targets (the current proposed changes) should a similar disclaimer be added to https://remix.run/docs/en/dev/tutorials/blog instead? to make it clear that the tutorial is assuming the deployment target is Remix App Server? The instructions made it seem like it’s choose your own adventure in terms of which deployment target you choose during the set up process.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:11 (1 by maintainers)

Top Related StackOverflow Question
Hi @ryanflorence I got the same issue, I even added the path
But it is still fail on Vercel
Do I miss anything?
I suppose we need to be more clear that this tutorial is an introduction to the moving parts of Remix, not a literal blog tutorial. You can’t use a file system in serveless environments, as stated in the tutorial, you should use a real db.