0
Guys, I followed the tutorial of the official website of Next.js in this link ( https://nextjs.org/learn/basics/dynamic-routes/render-markdown ) and I got the following error: "Server Error Error: Must use import to load ES Module: C: Users Gustavo Documents VSCODE Next.js Next.js Tutorial nextjs-blog node_modules Remark index.js require() of ES modules is not supported. require() of C: Users Gustavo Documents VSCODE Next.js Next.js Tutorial nextjs-blog node_modules Remark index.js from C: Users Gustavo Documents VSCODE Next.js Next.js Tutorial nextjs-blog.next server pages index.js is an ES module file as it is a . js file Whose Nearest Parent package.json contains "type": "module" which defines all . js files in that package Scope as ES modules. Instead Rename C: Users Gustavo Documents VSCODE Next.js Next.js Tutorial nextjs-blog node_modules Remark index.js to end in . cjs, change the requiring code to use import(), or remove "type": "module" from C: Users Gustavo Documents VSCODE Next.js Next.js Tutorial nextjs-blog node_modules Remark package.json.
This error happened while generating the page. Any console logs will be displayed in the terminal window. "
From what I understand there is some problem with the import or require commands, but I used import from start to link point without error. In this step of the link the blog stopped working.
I appreciate any help. The code is on: https://github.com/profglac/Next-blog
Put the piece of code to be analyzed too.
– Daniel Ikenaga