fix: avoid externalising node:async_hooks for the browser#16231
fix: avoid externalising node:async_hooks for the browser#16231teemingc wants to merge 7 commits into
node:async_hooks for the browser#16231Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/d5480d538218ce40da2a85e7c94bb566249e10a0Open in |
🦋 Changeset detectedLatest commit: d5480d5 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 |
| @@ -1,4 +1,3 @@ | |||
| /** @import { ReadableSpan } from '@opentelemetry/sdk-trace-node' */ | |||
|
Would wrapping the dynamic import with |
Tried that but unfortunately it doesn't work 😞 it might in the future? Rolldown still has some treeshaking issues so it's not on par with Rollup |
|
Another idea (not sure if it's better): Make |
Accidentally introduced in #16198 because our shared exports now transitively imports a file that should only run on the server. Can be reproduced by building any of our test apps that import from
@sveltejs/kitand you'll see an "externalized for browser" warning for the client build.This PR marks the als import call as pure so it can be treeshaken correctly from the client code but we remove the pure annotation for server builds to keep it. Not proud of how hacky this is and am open to alternatives.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits