-
-
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
prerender external links #3826
prerender external links #3826
Conversation
🦋 Changeset detectedLatest commit: 6a7f51b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✔️ Deploy Preview for kit-demo canceled. 🔨 Explore the source changes: 6a7f51b 🔍 Inspect the deploy log: https://app.netlify.com/sites/kit-demo/deploys/620bd81c681cf0000734b9bb |
External needs when another page on the same host handled by another service. For example, my case is
If I place link to lib site on main site without #1679 - crawler fails with 404. Maybe the logic of crawler can be changed to something like this:
|
You can control what happens when the crawler runs into a missing page with https://kit.svelte.dev/docs/configuration#prerender |
Yeah, I think I'm inclined to say that this can be handled via the // svelte.config.js
export default {
kit: {
prerender: {
onError: ({ status, path }) => {
if (path.startsWith('/svelte-virtual-scroll-list')) return;
throw new Error(`${status} ${path}`);
}
}
}
}; |
Ok, it looks good |
Added some docs: 6a7f51b |
Partially related discussion on Discord for those curious: https://discord.com/channels/457912077277855764/750401468569354431/943224194634764369 |
In #1679 we stopped crawling links with
rel="external"
during prerendering.rel="external"
is often used to force a full page navigation (instead of a client-side navigation), and in those cases is orthogonal to the question of whether something should be prerendered (see e.g. #3331).It seems like the simplest thing to do would simply be to follow those links, but @v1ack perhaps you can elaborate on the motivation for #1679?
The alternative would be to introduce a new construct for disabling client-side navigation on a link (i.e. a new
sveltekit:blah
attribute) but it would be better to avoid that unless we really need it.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpx changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0