nextjs-app-router-blog
nextjs-app-router-blog copied to clipboard
import fs from 'fs'
Hi thanks for this example. Just a short question: I get in ./lib/posts.ts Module not found: Can't resolve 'fs' any idea why this is happening? Thanks, and all the best, Matthias
Hi Matthias,
Mmmh, weird. Usually this error happens when someone tries to call the
Node.js fs module from the browser,
but since the import statement for the fs is in ./lib/posts.ts instead
of the app directory the error shouldn't occur.
Perhaps this behavior changed during the latest Next.js version? I'm not
sure...sorry I can't be of more help.
Best
On Mon, Dec 18, 2023 at 11:36 AM zeitvertrieb @.***> wrote:
Hi thanks for this example. Just a short question: I get in ./lib/posts.ts Module not found: Can't resolve 'fs' any idea why this is happening? Thanks, and all the best, Matthias
— Reply to this email directly, view it on GitHub https://github.com/emanuelefavero/nextjs-app-router-blog/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOFDHWN3C4LOQYGRT2N5CVLYKAMEFAVCNFSM6AAAAABAZJQ4ISVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA2DMMZSGU2DQMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
-- Emanuele Favero / Software Developer Full Stack Developer with love for Front-end and UX/UI Design. github/emanuelefavero https://github.com/emanuelefavero linkedin/emanuele-favero https://www.linkedin.com/in/emanuele-favero/