Skip to content

docs: mention nodejs_als compatibility flag #13605

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

Open
wants to merge 2 commits 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: 2e27a3e

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

This comment was marked as off-topic.

@Conduitry

This comment was marked as resolved.

@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?

@benmccann
Copy link
Member

@eltigerchino I just fixed the merge conflict on this one. Do you still think we should update the Cloudflare Workers docs since the two adapters have been merged? I see there's also a Cloudflare Workers section in the Cloudflare Adapter doc. You're more familiar with Cloudflare, so I thought you might have a good suggestion of what would need to be updated

@eltigerchino
Copy link
Member

Thank you!

Do you still think we should update the Cloudflare Workers docs since the two adapters have been merged?

We could because it should be the exact same as the Cloudflare docs so we can just copy and paste it.

I see there's also a Cloudflare Workers section in the Cloudflare Adapter doc. You're more familiar with Cloudflare, so I thought you might have a good suggestion of what would need to be updated

I think we might want to suggest having the compatibility flag added in the user's Wrangler config file over using the dashboard or CLI option so that it's always set up on deployment/dev. We might also want to explain it's only needed if using getRequestEvent asynchronously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation pkg:adapter-cloudflare
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WARNING] The package "node:async_hooks" wasn't found on the file system but is built into node.
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy