Skip to content

fix: avoid externalising node:async_hooks for the browser - #16244

Merged
teemingc merged 12 commits into
version-3from
internal-export-condition
Jul 6, 2026
Merged

teemingc merged 12 commits into
version-3from
internal-export-condition

Conversation

@teemingc

@teemingc teemingc commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

less hacky alternative to #16231 as suggested in #16231 (comment)

This PR adds conditions to the subpath export @sveltejs/kit/internal re-exports an import path similar to what we do for $app/paths so that the client/server variant of retrieving the URL origin is clearly separated. This helps avoid node:async_hooks from being pulled into the client build.

UPDATE: adding conditions to @sveltejs/kit/internal and referencing it from our @sveltejs/kit exports broke the types. We can probably get rid of our @sveltejs/kit/internal/server export altogether in another PR now that we have @sveltejs/kit/internal referencing the import path that has conditions


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

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.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants