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

[Bug?]: Error running on Cloudflare Workers #1160

Closed
2 tasks done
JAD3N opened this issue Dec 20, 2023 · 2 comments
Closed
2 tasks done

[Bug?]: Error running on Cloudflare Workers #1160

JAD3N opened this issue Dec 20, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@JAD3N
Copy link

JAD3N commented Dec 20, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

I receive the following error:

Cannot read properties of undefined (reading 'assets')

Expected behavior 🤔

I was hoping it would load the route.

Steps to reproduce 🕹

Steps:

  1. Set up Wrangler following Nitro: https://nitro.unjs.io/deploy/providers/cloudflare#cloudflare-workers
  2. Build using NITRO_PRESET=cloudflare bun run build
  3. Run bunx wrangler dev --local
  4. Open the browser and navigate to the website.

Context 🔦

Just trying to get Solid Start (0.4.1) to work with Cloudflare Workers.

Your environment 🌎

No response

@JAD3N JAD3N added the bug Something isn't working label Dec 20, 2023
@ryansolid
Copy link
Member

ryansolid commented Dec 20, 2023

To use AsyncLocalStorage we need to use node compat in Cloudflare. Moreover because Nitro patches it by default and it breaks, we need to exempt it. I've had success by using the cloudflare_module preset and some settings. I actually documented this because this was the one adapter I had issues with.

We need to organize the docs better.. but check out the special note on this page: https://start.solidjs.com/api/vite

@JAD3N
Copy link
Author

JAD3N commented Dec 20, 2023

Just applied the referenced tweaks and everything appears to be working great. Thanks for pointing that out for me!

@JAD3N JAD3N closed this as completed Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants