Closed matthamil closed 3 years ago
@matthamil Is it possible to see the code - perhaps an open repo? I notice that this is only loaded for /plugins/*
unlike the other pages which suggests that there is something different about this section of the site.
@danielroe My apologies, I had the code link on my clipboard but I'm dumb and didn't paste it into my original post.
@matthamil The issue is that that page wasn't being generated in advance. Check your generate script. It's throwing the following error:
ERROR Error generating route "/plugins/plugins/index": Plugin Doc not found
You have links to this non-existent page (and others) throughout, and the crawler is trying and failing to generate that page. Once you've replaced those links - a quick search/replace should do - everything should be copacetic.
A side note: consider using generate.fallback
to create your 404.html
- see docs.
Thanks a bunch @danielroe! This helped.
@matthamil A pleasure 😊
Version
@nuxt/content: 1.12.0 nuxt: 2.14.12
Reproduction Link
No minimal repro (yet)
Steps to reproduce
We recently rebuilt our documentation at Cypress.io to use nuxt and nuxt-content. We are building the site using
nuxt generate
. We have a page that is requesting thedb.json
file despite the site being generated withnuxt generate
and none of the client code is using$content
(this should only be called when building the static site). From what I've read, thedb.json
should not be loaded unless$content
is used client-side.Go to
https://docs.cypress.io
Click on "Plugins" in the top header
The page will not redirect immediately because the
db.json
file is being fetched.What is Expected?
The
/plugins
page does not fetchdb.json
since the$content
API is not being used client-side in this statically generated site.What is actually happening?
The
/plugins
page requests thedb.json
on load, causing a noticeable delay before the user can land on/plugins
.