Skip to content
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

docs: mention nodejs_als compatibility flag #13605

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

max-lt
Copy link

@max-lt max-lt commented Mar 18, 2025

Hello, I noticed some warning when running a cloudflare-adapter project with wrangler

npx wrangler pages dev .svelte-kit/cloudflare

▲ [WARNING] The package "node:async_hooks" wasn't found on the file system but is built into node.

  Your Worker may throw errors at runtime unless you enable the "nodejs_compat" compatibility flag.
  Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details. Imported
  from:
   - .wrangler/tmp/pages-mQuBz9/bundledWorker-0.48410322524810456.mjs

Seems due to the missing AsyncLocalStorage API in workers by default.
I added some instructions to the doc to enable the required compatibility flag.

Copy link

changeset-bot bot commented Mar 18, 2025

⚠️ No Changeset found

Latest commit: e647e04

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svelte-docs-bot
Copy link

@benmccann benmccann added the documentation Improvements or additions to documentation label Mar 18, 2025
@benmccann
Copy link
Member

I think this may no longer be necessary because of #13607

@Conduitry
Copy link
Member

I think this may no longer be necessary because of #13607

I would doubt it. The PR just removed the top-level await - the import of node:async_hooks is still present.

@eltigerchino eltigerchino changed the title Update adapter-cloudflare documentation docs: mention nodejs_als compatibility flag Mar 19, 2025
@eltigerchino
Copy link
Member

Thanks for this. Can you update the Cloudflare Workers adapter docs too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants