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
ReferenceError: require is not defined in ES module scope, you can use import instead
at file:///C:/Users/H378136/Documents/Index/React/react-next13/03-blog-next-mdx/next.config.mjs:1:30
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
at async loadConfig (C:\Users\H378136\Documents\Index\React\react-next13\03-blog-next-mdx\node_modules\next\dist\server\config.js:696:36)
at async nextDev (C:\Users\H378136\Documents\Index\React\react-next13\03-blog-next-mdx\node_modules\next\dist\cli\next-dev.js:197:14)
at async main (C:\Users\H378136\Documents\Index\React\react-next13\03-blog-next-mdx\node_modules\next\dist\bin\next:155:5)
Node.js v21.7.1
The text was updated successfully, but these errors were encountered:
Error when running npm run dev with next 13 and Contentlayer
"next": "14.1.4"
"next-contentlayer": "^0.3.4"
Error:
PS C:\Users\H378136\Documents\Index\React\react-next13\03-blog-next-mdx> npm run dev
file:///C:/Users/H378136/Documents/Index/React/react-next13/03-blog-next-mdx/next.config.mjs:1
const { withContentlayer } = require("next-contentlayer");
^
ReferenceError: require is not defined in ES module scope, you can use import instead
at file:///C:/Users/H378136/Documents/Index/React/react-next13/03-blog-next-mdx/next.config.mjs:1:30
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
at async loadConfig (C:\Users\H378136\Documents\Index\React\react-next13\03-blog-next-mdx\node_modules\next\dist\server\config.js:696:36)
at async nextDev (C:\Users\H378136\Documents\Index\React\react-next13\03-blog-next-mdx\node_modules\next\dist\cli\next-dev.js:197:14)
at async main (C:\Users\H378136\Documents\Index\React\react-next13\03-blog-next-mdx\node_modules\next\dist\bin\next:155:5)
Node.js v21.7.1
The text was updated successfully, but these errors were encountered: