-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Adapter Static is buggy #10433
Comments
You're not exporting That's my first thought - I think I ran into this a while back. In addition, as a stylistic tip, it's now possible to export |
There was a change where you have to explicitly mention that all pages are pre-renderable by adding the following setting. This is also mentioned in the error message when the build fails in your reproduction. // src/routes/+layout.js
export const prerender = true; I've added the file and the build completes successfully. Can you confirm if the following output is what you expected? EDIT: whoops, someone posted a better explanation earlier. |
@infovore and @s3812497 I forgot to add the It builds the project now, different from my local project, I don't know why in my machine it does not work, but I'll try to figure it out based on this Stackblitz Project. |
@s3812497 The issue is not resolved yet. If you see the StackBlitz Project, I added a route called So I added a Now it simply bugs everything and says all pages are dynamic: @sveltejs/adapter-static: all routes must be fully prerenderable, but found the following routes that are dynamic:
- src/routes/
- src/routes/api/get-all
- src/routes/[name]
- src/routes/[name]/test
- src/routes/[name]/[project] This is the bug I'm having right now to update the app, as I fixed all the issues it says everything is dynamic... |
The builder error message is definitely confusing because it lists all your routes when it should only list the problematic one (which is When using
Your pages must be discoverable either by including it in a link somewhere in your app or specifying it with |
+1 to what @s3812497 said:
data.projects.forEach(({ name }) => {
links.push(`/${user}/${name}`);
links.push(`/${user}/test`);
}); (or, indeed, add
Here's a stackblitz where this works. I don't understand why |
Describe the bug
I have a project with two dynamic nested routes:
/[name]/[project]
. During development I know whatname
andproject
should be, the route should be something like/daniel/portfolio
.I was using SvelteKit beta from Feb 2022
version 1.0.0-next.267
, on thesveltekit.config.js
I created an array of entries that correspond to all possibilities of[name]
and[project]
params, so the final array onprerender.entries
is['*', '/daniel/portfolio']
.The build works flawlessly, generating the
/daniel.html
and/daniel/portfolio.html
like it was supposed to be.This is with SvelteKit
1.0.0-next.267
and adapter static1.0.0-next.26
. Using up-to-date packages, no matter what I do, the build simply does not work, I use the same configuration onsvelte.config.js
, I use theentries
function to get the value of[name]
and[project]
params, nothing works, theadapter-static
says all routes are dynamic, even absolute static ones liketest/+page.svelte
with only ah1
inside.How to make this thing work?!
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-c1arfw?file=svelte.config.js
Logs
No response
System Info
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: