db.json is loaded client-side for static site that is not using $content within the client code
See original GitHub issueVersion
@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 the db.json
file despite the site being generated with nuxt 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, the db.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 fetch db.json
since the $content
API is not being used client-side in this statically generated site.
What is actually happening?
The /plugins
page requests the db.json
on load, causing a noticeable delay before the user can land on /plugins
.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thanks a bunch @danielroe! This helped.
@matthamil A pleasure 😊