-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support NextJS 14 #575
Comments
cc @schickling |
For me it only fails when running with |
@marcofranssen it runs fine for me too, but when I run |
Me too hope fix it. |
Same error as @nebrelbug faced, I 'resolved' in the short term by:
|
Until people get this fixed you can add
|
I believe that not only support should be added but errors should be replaced for warnings to avoid builds failing. Like, in this specific case, if it wasn't throwing but showing a warning instead, we wouldn't be having this issue. Support would be requested, yes, but wouldn't be critical as it is of now 🥲 |
This is the NPM ecosystem throwing the errors. Nothing this project can do about that. |
Is there a way to prevent this? I find this somewhat dangerous, it literally blocks the production builds (in this case, for no reason, basically above my own will). |
Any news related to this issue? Has it been fixed yet ? |
Unexpected scalar at node end at line 4, column 201: (like this).
Only facing this issue when I'm using the latest contentlayer. (I'm using nextjs14) |
+1 for nextjs14 support. It works fine so it shouldn't be hard to clean up the dependency requirements of the package. |
Just use the |
For the ones looking for a fix! I was using npm and merge to pnpm! it did the trick for me! |
Yeah definitely downgrade to next 13 or 13.5.6 |
No issues seems to be addressed and PR merged, is the project dying and we should consider other options? |
Looks like 3 options until this issue is addressed:
Ran into the below with both Next 13 and 14. If you install
|
@piotrszubert pointed out this solution in another thread on this issue, which is to put this in your package.json: "overrides": {
"next-contentlayer": {
"next": "$next"
}
}, Personally, I think it's the cleanest solution. |
Is it recommended for production? |
All of these fixes are somewhat janky. They bypass the error without resolving the underlying issue. If stability in your production environment is really critical it seems best to downgrade your Next version instead. Otherwise, I think
(I'm no expert on NPM) |
any news on this? if the code is open source we can just PR the change |
Yeah, but even current open PRs are not handled. And who is going to cut releases so people can get a new version? :( Or they are closed by a bot #556 |
https://www.codemotion.com/magazine/frontend/how-to-create-an-mdx-blog-in-typescript-with-next-js/ Here bro come follow this guide and just build your own components |
This is how I migrated from ContentLayer to Next MDX: Was tired of wrestling with this library :( |
@XahidEx just change the line endings for your mdx file from CRLF to LF. It's an old issue for contentlayer, cuz Windows uses CRLF endings. |
Contentlayer is probably not being maintained anymore as per this issue: #429 |
yea i cant move on using contentlayer anymore even though it was an excellent solution! for anyone that is looking for other alternatives: I'm now using mintlify free plan. for my usecase of just having blog posts setting this up was super simple! it also comes with lots of helpful components as well |
is there something I should pay particular attention to when using this solution? |
What it's doing is pretty simple. It's basically overriding Contentlayer's desired version of Next to whatever you have installed. The main thing to be aware of is that this only works because Contentlayer doesn't actually have any compatibility issues with NextJS 14. However, in the future it may indeed actually break and this fix won't do anything. |
This is becoming more critical due to a recent CVE CVE-2024-34351 |
Locally, we can use the -force option to run it, but what should we do during deployment? |
You can edit your package installation command on Vercel. And if you are deploying somewhere else you always have control over than anyways, |
I highly recommend switching over to https://github.com/sdorra/content-collections. I was able to switch over quite easily and Zod schemas are super nice. Feature parity seems completely on par with Contentlayer. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi, can we use content collections in next.js latest versions? |
The text was updated successfully, but these errors were encountered: