Open tianyingchun opened 5 months ago
"contentlayer2": "0.4.6", "next-contentlayer2": "0.4.6",
Sorry, could you elaborate on what causes the error and provide a small reproducible is possible?
okay, i will find time to make a small reproduce repo
Am also getting this, npm run dev
works fine, but no posts show up on build
Edit: oops, posts do show up, I set draft to true by accident. Despite this error, everything still appears to be running fine.
Could you include more information on the version of Next and React that you are using as well. I just tested on Next 15 canary and React 19 without issue - https://stackblitz.com/edit/github-ekmxur-ba82kk?file=package.json
see here https://github.com/tianyingchun/tailwind-nextjs-starter-blog-issue
Ah this is the same issue as https://github.com/contentlayerdev/contentlayer/issues/313. It's a Webpack warning that can be ignored: https://github.com/webpack/webpack/pull/15688. Or if you don't use "type": "module"
, you can avoid this error as well.
yes, i know, but don't know why, i just switch to turbo
& webpack in memory cache.
I'm getting this too with "contentlayer2": "^0.5.0"
. Definitely triggered by "type": "module"
in package.json but would be awesome if there was a way to remove it.
is proposed solution adding this to next.config under the webpack? (see here)
config.infrastructureLogging = {
level: "error",
};
Generated 13 documents in .contentlayer ✓ Ready in 3.7s ○ Compiling / ... ✓ Compiled / in 4.9s (1255 modules) GET / 200 in 5301ms ✓ Compiled in 340ms (580 modules)