You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a situation where the content on a static site is determined by markdown files. These markdown files may include images by referencing an endpoint that automatically creates optimized images. This endpoint is marked to prerender. Because I don't manage the content (it will be managed with a git-based CMS by other people), there may be cases where no images are referenced in any markdown file. In this case, the build fails.
I have tested this with adapter-static, adapter-node and adapter-auto. Setting strict: false for adapter-static does not fix it.
I don't think I am doing anything that I shouldn't. It seems reasonable to prerender an endpoint that does image optimization when the content doesn't change after building. Of course, removing the endpoint, when no images are linked in any markdown file, would fix it, but I obviously cannot expect people who manage the content to do this.
The closest past issue I found is this: #7183, but it does not seem to be my situation exactly.
Install dependencies with npm i and then build with npm run build.
Uncommenting # image: /images/demo-image.jpg in src/content/posts/demo-page.md allows the build to work.
The endpoint in question can be found at src/routes/images/[slug].[type]@[query].[ending]/+server.ts.
I tried to remove everything unnecessary from the repo and I hope it is clear enough.
Logs
node:internal/event_target:1100
process.nextTick(() => { throw err; });
^
Error: The following routes were marked as prerenderable, but were not prerendered because they were not found while crawling your app:
- /images/[slug].[type]@[query].[ending]
See https://kit.svelte.dev/docs/page-options#prerender-troubleshooting for info on how to solve this
at prerender (file:///home/flounder/git/sveltekit-decapcms/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:495:9)
at async MessagePort.<anonymous> (file:///home/flounder/git/sveltekit-decapcms/node_modules/@sveltejs/kit/src/utils/fork.js:22:16)
Emitted 'error' event on Worker instance at:
at [kOnErrorMessage] (node:internal/worker:326:10)
at [kOnMessage] (node:internal/worker:337:37)
at MessagePort.<anonymous> (node:internal/worker:232:57)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28)
Node.js v20.11.1
Describe the bug
I have a situation where the content on a static site is determined by markdown files. These markdown files may include images by referencing an endpoint that automatically creates optimized images. This endpoint is marked to prerender. Because I don't manage the content (it will be managed with a git-based CMS by other people), there may be cases where no images are referenced in any markdown file. In this case, the build fails.
I have tested this with adapter-static, adapter-node and adapter-auto. Setting
strict: false
for adapter-static does not fix it.I don't think I am doing anything that I shouldn't. It seems reasonable to prerender an endpoint that does image optimization when the content doesn't change after building. Of course, removing the endpoint, when no images are linked in any markdown file, would fix it, but I obviously cannot expect people who manage the content to do this.
The closest past issue I found is this: #7183, but it does not seem to be my situation exactly.
Reproduction
https://github.com/salty-muffin/sveltekit-decapcms/tree/reproduction
Install dependencies with
npm i
and then build withnpm run build
.Uncommenting
# image: /images/demo-image.jpg
insrc/content/posts/demo-page.md
allows the build to work.The endpoint in question can be found at
src/routes/images/[slug].[type]@[query].[ending]/+server.ts
.I tried to remove everything unnecessary from the repo and I hope it is clear enough.
Logs
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: