Skip to content

Comments

fix: ensure server load data requests are routed#15367

Merged
dummdidumm merged 3 commits intomainfrom
fix-netlify-load-functions
Feb 20, 2026
Merged

fix: ensure server load data requests are routed#15367
dummdidumm merged 3 commits intomainfrom
fix-netlify-load-functions

Conversation

@teemingc
Copy link
Member

@teemingc teemingc commented Feb 20, 2026

fixes #15329 (reply in thread)

This PR fixes a regression in the Netlify split function routing where __data.json requests weren't hitting any functions.

Tested on Netlify too https://15329.netlify.app/ (you should be able to navigate to the /wordle page without an error)


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link

changeset-bot bot commented Feb 20, 2026

🦋 Changeset detected

Latest commit: 5d75375

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/adapter-netlify Patch

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

for (const segment of route.segments) {
if (segment.rest) {
parts.push('*');
break; // Netlify redirects don't allow anything after a *
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't apply anymore after we moved away from the hacky generated redirects routing. Netlify now uses URLPattern and it allows the wildcard at any position

relativePath: '../server'
generate_serverless_function({
builder,
routes: undefined,
Copy link
Member Author

@teemingc teemingc Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing undefined here means the function handles all routes instead of just specific ones. Admittedly, this could be conveyed better (maybe by making it optional?). It's different from routes: [] which is what we'd use to create a catch-all to display a 404 in the future

@dummdidumm dummdidumm merged commit 6f9114f into main Feb 20, 2026
29 of 30 checks passed
@dummdidumm dummdidumm deleted the fix-netlify-load-functions branch February 20, 2026 20:56
@github-actions github-actions bot mentioned this pull request Feb 20, 2026
dummdidumm pushed a commit that referenced this pull request Feb 20, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @sveltejs/adapter-netlify@6.0.3

### Patch Changes

- fix: correctly route requests to server load functions when the
adapter is configured to used split functions
([#15367](#15367))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants