@nuxtjs/content
When I use https://content.nuxtjs.org/ in my build. I get a 404 for the fetch.
When I run npm run build and npm run start locally it works fine.
Any Idea why it might not work?
@eigenmannmartin Do you use 2.14? Before that you had to use the generate function to tell nuxt which routes to generate. Take a look at their documentation.
@appinteractive I am using
"@nuxt/content": "^1.3.2", and "nuxt": "^2.13.0",
I will update and check again :+1: Thank you very much!
Same error here with the latest version. It seems, that content folder is not added to the server files. I have solved it by adding content folder to now.json config:
{
"version": 2,
"builds": [
{
"src": "nuxt.config.js",
"use": "@nuxtjs/now-builder",
"config": {
"serverFiles": ["content/**"]
}
}
]
}
This solves the 502 error which couldn't fetch any files and /_content/articles is accessible and returns all results.
Regardless, after accessing the page with @nuxtjs/content content, I'm getting Error:
Uncaught (in promise) TypeError: Cannot read property 'chain' of null
Check logs for SSR here: https://vercel.com/dawidstefaniak/content-test/14k0i7avq/functions And link: https://content-test-14k0i7avq.vercel.app/articles
Logs for SPA (for reference that it does work): https://vercel.com/dawidstefaniak/content-test/px349i0a8
Any help with that? I think it may be some error with @nuxtjs/content itself.
In a serverless environment you can't access your own API endpoints within the serverless function, which is what the content module relies on. (That is, for example, you can't try an HTTP get request to an endpoint served by the function - because it won't be accessible via http://localhost: 3000.) Short of it being rewritten, I can't see this being compatible with serverless SSR.
For anyone going through this, I don't know if something was fixed but the config below works for me in SSR. The /_content/ API is available too.
{
"builds": [
{
"src": "nuxt.config.js",
"use": "@nuxtjs/vercel-builder",
"config": {
"serverFiles": [
".nuxt/content/**",
"content/**"
]
}
}
]
}
Yes, this is now possible with https://github.com/nuxt/vercel-builder/pull/375
Hello, I think I got the same problem.
In dev mode, I have no problems with nuxt/content. But when I try to build it in order to npm run start, i got problems.
You can see here the error which appears in console.

I tried a lot of methods, i updated my nuxt/content ( i am currently in v1.14.0 for content and my nuxt is v2.15.2).
Do you have an idea ?
Solution
My application is a SPA, so I have to have a 'static' target.
@MarquesFlorian Did you find a fix for this issue?
I don't remember how I solved it but I think that was coming of my "mode Property" of the application. (spa or universal).
@MarquesFlorian Did you find a fix for this issue?
@MarquesFlorian Ah okay. My site was having a similar issue; it was 404'ing on a .json path that did not exist and logged _chain of null. Oddly, Vercel source did show the Nuxt Content folder having some valid JSON just not at the path that the app was trying to load.