-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
You should use slots
error when previewing non-ssr application
#1202
Comments
Update After trying few things out it seems like the issue is with the parser or query results. if you comment out the:
In DOM you see the following: And a perfectly rendered list: And no errors in console. So what I think is happening is - the nuxt content is querying data and thinks that a perfectly valid data is returned, so he renders it. And when I try to render a markdown specifically - it shows the error as the data in not markdown format (i.e. Anyways, I think this is a bug in any case. Error should be shown if data is invalid or missing. And, I still hope that you could provide some examples how to do the pre-rendering properly. And if pre-rendering is not supposed to work then please update the documentation. |
Thank you for the issue and description. Generating non-ssr websites is tricky and yet not supported in V2. |
I'd suggest using I'm closing this in favor of #1229. |
Environment
Nuxt CLI v3.0.0-rc.3 21:25:08
RootDir: C:\DEV\reposGithub\nuxt-starter-bug-repro.git 21:25:11
Nuxt project info: 21:25:11
Windows_NT
v16.13.1
3.0.0-rc.3
npm@8.7.0
vite
ssr
,modules
,content
@nuxt/content@2.0.1
-
Reproduction
Repro repo: https://github.com/pavlexander/nuxt-starter-bug-repro
nuxt-starter
https://stackblitz.com/edit/nuxt-starter-njk4bl?file=README.mdssr: false,
in nuxt confignpm run dev
Observe no errors during runtime, list is rendered
npm run generate
npm run preview
Markdown content not rendered. Error is shown
You should use slots with <ContentRenderer>
Describe the bug
I have initially reported this bug in supposedly same issue: #1154 (comment)
The bug, basically, does not allow you to pre-render the nuxt content (markdown pages). Because every time you try to render them you get the error as in description above.
The issue is not reproducible when you run serve the application from
npm run dev
command.Additional context
What I try to achieve is to enable pre-rendering of all pages. So I could host my vue app without the backend server.
It could either be an SPA with pre-rendered pages or a fully static pre-generated website. Currently I am trying to do the former.
Logs
No response
The text was updated successfully, but these errors were encountered: