Skip to content

fix: use index for filenames - #17049

Merged
teemingc merged 9 commits into
version-3from
netlify-function-name-collision
Sep 7, 2026
Merged

teemingc merged 9 commits into
version-3from
netlify-function-name-collision

Conversation

@teemingc

@teemingc teemingc commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

This PR swaps out the error-prone serverless function file naming of replacing symbols in the route id to using an index (similar to the Vercel adapter). This fixes a situation where a /foo.bar route would be overridden by /foo_bar because we were replacing . with _.

It also adds the route id to the display name for the serverless function, shown in the Netlify function logs.


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.

@teemingc teemingc added pkg:adapter-netlify needs-platform-tests This PR needs to run platform tests in order to merge. labels Sep 7, 2026
@pkg-svelte-dev

pkg-svelte-dev Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 2130a65:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/2130a65cd5930800f5afdb8a9cbbf24850e742a9

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/17049

@changeset-bot

changeset-bot Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2130a65

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

@svelte-docs-bot

Copy link
Copy Markdown

@teemingc teemingc mentioned this pull request Sep 7, 2026
4 of 6 tasks
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: QUIET

Plan: Advanced

Run ID: 6e81b4e5-c28f-4b76-91b0-3815cafd3323

📥 Commits

Reviewing files that changed from the base of the PR and between a82d344 and 2130a65.

📒 Files selected for processing (1)
  • packages/adapter-netlify/index.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • sveltejs/vite-plugin-svelte (manual)
  • vitejs/vite (manual)
  • sveltejs/svelte (manual)

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The Netlify adapter now assigns sequential names such as sveltekit-0 to split serverless functions. It passes route-specific display names separately to Netlify configuration generation. Catch-all and singular functions use dedicated display names. Split build tests inspect generated function content and verify display names and distinct outputs for sanitised route collisions. Two collision test routes provide distinct server responses.

Merge Risk: ⚪ Minimal · up to 2130a

Netlify split functions now receive unique internal filenames, preventing colliding routes from overwriting each other while preserving readable route names in function logs. The change includes coverage for the collision case and is ready to merge.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required fix: prefix and accurately describes the change to use indexed filenames for serverless functions.
Backward Compatibility Impact Disclosure ✅ Passed No breaking public interface change is introduced. The PR keeps the default export and AdapterOptions unchanged, including the split and edge defaults. It adds no required request or response fi…

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/adapter-netlify/index.js

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


Comment @coderabbitai help to get the list of available commands.

Base automatically changed from netlify-build-tests to version-3 September 7, 2026 16:15
@teemingc
teemingc force-pushed the netlify-function-name-collision branch from a82d344 to fa6a11e Compare September 7, 2026 16:15
@teemingc
teemingc merged commit 1c8b034 into version-3 Sep 7, 2026
41 checks passed
@teemingc
teemingc deleted the netlify-function-name-collision branch September 7, 2026 16:42
teemingc pushed a commit that referenced this pull request Sep 8, 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 version-3, this PR
will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`version-3` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `version-3`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## @sveltejs/adapter-cloudflare@8.0.0-next.7

### Major Changes

- breaking: populate env vars before `instrumentation.server.js` is
evaluated and update the adapter instrumentation API
([#16303](#16303))

- breaking: remove cloudflare `platform`, emulate the
`cloudflare:workers` module instead
([#16754](#16754))

- breaking: replace the `builder.generateManifest` with
`builder.generateServerInstance` and `builder.manifest`
([#16875](#16875))

### Patch Changes

- Updated dependencies
[[`9a4b343`](9a4b343),
[`ee2f55b`](ee2f55b),
[`65673a4`](65673a4),
[`1b79845`](1b79845),
[`b12bb78`](b12bb78),
[`03f1687`](03f1687),
[`49f0808`](49f0808),
[`e7c74bf`](e7c74bf),
[`0876d63`](0876d63),
[`9a2b9ba`](9a2b9ba),
[`c9f54b5`](c9f54b5),
[`22b8152`](22b8152),
[`f6d44cf`](f6d44cf),
[`3c3a27b`](3c3a27b),
[`7f376b1`](7f376b1),
[`8a587c7`](8a587c7),
[`aa4f960`](aa4f960)]:
  - @sveltejs/kit@3.0.0-next.27
## @sveltejs/adapter-netlify@7.0.0-next.11

### Major Changes

- breaking: populate env vars before `instrumentation.server.js` is
evaluated and update the adapter instrumentation API
([#16303](#16303))

- breaking: replace the `builder.generateManifest` with
`builder.generateServerInstance` and `builder.manifest`
([#16875](#16875))

### Patch Changes

- fix: route requests with omitted optional parameters to split
serverless functions
([#17020](#17020))

- fix: copy `_redirects` when deploying edge function
([#17047](#17047))

- chore: replace `@iarna/toml` with `smol-toml`
([#16948](#16948))

- chore: identify serverless functions with a UUID instead of Netlify's
function token ([#17044](#17044))

- fix: ensure serverless function files have unique names
([#17049](#17049))
- Updated dependencies
[[`9a4b343`](9a4b343),
[`ee2f55b`](ee2f55b),
[`65673a4`](65673a4),
[`1b79845`](1b79845),
[`b12bb78`](b12bb78),
[`03f1687`](03f1687),
[`49f0808`](49f0808),
[`e7c74bf`](e7c74bf),
[`0876d63`](0876d63),
[`9a2b9ba`](9a2b9ba),
[`c9f54b5`](c9f54b5),
[`22b8152`](22b8152),
[`f6d44cf`](f6d44cf),
[`3c3a27b`](3c3a27b),
[`7f376b1`](7f376b1),
[`8a587c7`](8a587c7),
[`aa4f960`](aa4f960)]:
  - @sveltejs/kit@3.0.0-next.27
## @sveltejs/adapter-node@6.0.0-next.12

### Major Changes

- breaking: populate env vars before `instrumentation.server.js` is
evaluated and update the adapter instrumentation API
([#16303](#16303))

- breaking: replace the `builder.generateManifest` with
`builder.generateServerInstance` and `builder.manifest`
([#16875](#16875))

### Patch Changes

- Updated dependencies
[[`9a4b343`](9a4b343),
[`ee2f55b`](ee2f55b),
[`65673a4`](65673a4),
[`1b79845`](1b79845),
[`b12bb78`](b12bb78),
[`03f1687`](03f1687),
[`49f0808`](49f0808),
[`e7c74bf`](e7c74bf),
[`0876d63`](0876d63),
[`9a2b9ba`](9a2b9ba),
[`c9f54b5`](c9f54b5),
[`22b8152`](22b8152),
[`f6d44cf`](f6d44cf),
[`3c3a27b`](3c3a27b),
[`7f376b1`](7f376b1),
[`8a587c7`](8a587c7),
[`aa4f960`](aa4f960)]:
  - @sveltejs/kit@3.0.0-next.27
## @sveltejs/adapter-vercel@7.0.0-next.9

### Major Changes

- breaking: populate env vars before `instrumentation.server.js` is
evaluated and update the adapter instrumentation API
([#16303](#16303))

- breaking: replace the `builder.generateManifest` with
`builder.generateServerInstance` and `builder.manifest`
([#16875](#16875))

### Patch Changes

- fix: pass the requested pathname, including any trailing slash, to ISR
functions ([#16903](#16903))

- fix: trace `process.cwd()`-relative files from the project directory
and never glob from the filesystem root
([#16972](#16972))
- Updated dependencies
[[`9a4b343`](9a4b343),
[`ee2f55b`](ee2f55b),
[`65673a4`](65673a4),
[`1b79845`](1b79845),
[`b12bb78`](b12bb78),
[`03f1687`](03f1687),
[`49f0808`](49f0808),
[`e7c74bf`](e7c74bf),
[`0876d63`](0876d63),
[`9a2b9ba`](9a2b9ba),
[`c9f54b5`](c9f54b5),
[`22b8152`](22b8152),
[`f6d44cf`](f6d44cf),
[`3c3a27b`](3c3a27b),
[`7f376b1`](7f376b1),
[`8a587c7`](8a587c7),
[`aa4f960`](aa4f960)]:
  - @sveltejs/kit@3.0.0-next.27
## @sveltejs/kit@3.0.0-next.27

### Major Changes

- major: error when a client-requested single-flight mutation isn't
respected by the server, allow the server to explicitly ignore refreshes
([#16892](#16892))

- breaking: remove `Server` constructor and `SSRManifest` from public
types ([#16876](#16876))

- breaking: replace the `builder.generateManifest` with
`builder.generateServerInstance` and `builder.manifest`
([#16875](#16875))

### Minor Changes

- feat: allow adapters to receive the Svelte config as a function
argument when adding Vite plugins
([#16986](#16986))

- feat: allow adapters to override `getRequest` and `setResponse` during
`vite dev` and `vite preview`
([#16753](#16753))

### Patch Changes

- fix: respect `paths.relative` during development for client files
([#17053](#17053))

- fix: clarify circular imports from `src/env`
([#17014](#17014))

- breaking: populate env vars before `instrumentation.server.js` is
evaluated and update the adapter instrumentation API
([#16303](#16303))

- fix: record a history traversal before resolving its route
([#16959](#16959))

- fix: support coordinate objects from image inputs in remote forms
([#16944](#16944))

- fix: walk and copy directories without a stat per file
([#16995](#16995))

- fix: widen remote form fields for union schemas and string enums
([#16937](#16937))

- fix: respond to `HEAD` requests without a body
([#17036](#17036))

- chore: replace deprecated Vite dev server APIs
([#16961](#16961))

- fix: settle a query's pending request in place when its value arrives
through `set()` ([#16958](#16958))

- fix: prevent `await_reactivity_loss` warning and
`state_unsafe_mutation` error when the new version detector runs after
an `await` ([#16915](#16915))

- chore: parse page options and remote modules with Vite's `parseSync`
instead of `acorn`
([#16947](#16947))
## @sveltejs/adapter-auto@8.0.0-next.4

### Minor Changes

- feat: add zero-config deployment support for Render
([#16850](#16850))

### Patch Changes

- Updated dependencies
[[`9a4b343`](9a4b343),
[`ee2f55b`](ee2f55b),
[`65673a4`](65673a4),
[`1b79845`](1b79845),
[`b12bb78`](b12bb78),
[`03f1687`](03f1687),
[`49f0808`](49f0808),
[`e7c74bf`](e7c74bf),
[`0876d63`](0876d63),
[`9a2b9ba`](9a2b9ba),
[`c9f54b5`](c9f54b5),
[`22b8152`](22b8152),
[`f6d44cf`](f6d44cf),
[`3c3a27b`](3c3a27b),
[`7f376b1`](7f376b1),
[`8a587c7`](8a587c7),
[`aa4f960`](aa4f960)]:
  - @sveltejs/kit@3.0.0-next.27
## @sveltejs/package@3.0.0-next.8

### Patch Changes

- chore: read the Svelte config via `@sveltejs/load-config`
([#17039](#17039))

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

Labels

needs-platform-tests This PR needs to run platform tests in order to merge. pkg:adapter-netlify

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants