You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following step by step by this tutorial, you will get Module not found: Can't resolve 'fs' error from the lib/posts.js.
and map of 'allPostsData' is undefined.
orassayag
changed the title
Induction tutorial to Next.js is outdated and has errors.
Induction tutorial to Next.js is outdated and have errors.
Nov 26, 2020
orassayag
changed the title
Induction tutorial to Next.js is outdated and have errors.
Introduction tutorial to Next.js is outdated and have errors.
Nov 26, 2020
@orassayag There were some steps that weren't very clear on that pasting some code would break the page until you pasted the code of the next step. Module not found: Can't resolve 'fs' was one of those cases (happened after adding an import of a Node.js module, but not using it inside getStaticProps).
I've added multiple updates to places where bad situations like that could happen and also more additional updates to make sure every step is more clear than before regarding what code do you have to change and where.
@orassayag There were some steps that weren't very clear on that pasting some code would break the page until you pasted the code of the next step. Module not found: Can't resolve 'fs' was one of those cases (happened after adding an import of a Node.js module, but not using it inside getStaticProps).
I've added multiple updates to places where bad situations like that could happen and also more additional updates to make sure every step is more clear than before regarding what code do you have to change and where.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 29, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Module not found: Can't resolve 'fs'
Describe the bug
When doing the intrudction toturial to Next.js there are several bugs.
In the section of 'Pre-rendering and Data Fetching' (called 'Implement getStaticProps' on the side menu):
https://nextjs.org/learn/basics/data-fetching/implement-getstaticprops
Following step by step by this tutorial, you will get
Module not found: Can't resolve 'fs'
error from the lib/posts.js.and map of 'allPostsData' is undefined.
Steps to reproduce the behavior, please provide code snippets or a repository:
Do the tutorial until the step of:
https://nextjs.org/learn/basics/data-fetching/implement-getstaticprops
Expected behavior
Will show the posts.
Screenshots
System information
Additional context
I solved the issue by this link:
#7755
Need to add next.config.js file with:
P.S, A general opinion on this tutorial - It's really good, but if you can:
The text was updated successfully, but these errors were encountered: