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: SolidJs and cloudflare workers doesnt work #4039

Closed
1 task
PringlePot opened this issue Jul 25, 2022 · 6 comments
Closed
1 task

🐛 BUG: SolidJs and cloudflare workers doesnt work #4039

PringlePot opened this issue Jul 25, 2022 · 6 comments
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@PringlePot
Copy link

PringlePot commented Jul 25, 2022

What version of astro are you using?

1.0.0-beta.73

Are you using an SSR adapter? If so, which one?

Cloudflare

What package manager are you using?

yarn

What operating system are you using?

Windows

Describe the Bug

When running solidjs with the cloudflare ssr adapter, it errors with Error: Pa is not supported in the browser, returning undefined

Link to Minimal Reproducible Example

https://github.com/PringlePot/astro-solid-and-cloudflare

Participation

  • I am willing to submit a pull request for this issue.
@PringlePot PringlePot changed the title 🐛 BUG: 🐛 BUG: SolidJs and cloudflare workers doesnt work Jul 25, 2022
@PringlePot
Copy link
Author

Just updated the link to a github repo that recreates the issue

@matthewp matthewp added the - P3: minor bug An edge case that only affects very specific usage (priority) label Jul 26, 2022
@PringlePot
Copy link
Author

This issue consists when updating to v1.0.0-rc.6

@Nike682631
Copy link

@matthewp Is this issue available to work on?

@jazoom
Copy link

jazoom commented Aug 29, 2022

I can't get them working together in the latest versions

{
  "name": "@example/basics",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "dev": "astro dev",
    "start": "astro dev",
    "build": "astro check && tsc && astro build",
    "preview": "wrangler pages dev ./dist",
    "astro": "astro"
  },
  "devDependencies": {
    "@astrojs/cloudflare": "^1.0.1",
    "@astrojs/solid-js": "^1.1.0",
    "@astrojs/tailwind": "^1.0.0",
    "astro": "^1.1.1",
    "solid-js": "^1.4.3",
    "wrangler": "^2.0.27"
  }
}

yarn dev works fine
yarn build seems to work

yarn preview gives this:

$ yarn preview
yarn run v1.22.19
$ wrangler pages dev ./dist
🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose
✘ [ERROR] _worker.js is importing from another file. This will throw an error if deployed.

  You should bundle your Worker or remove the import if it is unused.

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ [b] open a browser, [d] open Devtools, [c] clear console, [x] to exit                                                                                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Starting inspector on 0.0.0.0:9229 failed: address already in use
[pages:wrn] Service bindings are experimental. There may be breaking changes in the future.
[pages:inf] Worker reloaded! (126.90KiB)
[pages:inf] Listening on 0.0.0.0:8788
[pages:inf] - http://127.0.0.1:8788
[pages:inf] - http://10.0.0.114:8788
[pages:inf] - http://100.78.77.87:8788
[pages:inf] Updated `Request.cf` object cache!
Error: An is not supported in the browser, returning undefined

I can access the page at http://127.0.0.1:8788 but the SolidJS component doesn't load.

@AirBorne04
Copy link
Contributor

for your wrangler command to work you do need to build for mode: "directory" in the cloudflare settings. the error You should bundle your Worker or remove the import if it is unused. is typical for building for workers and running wrangler with pages param.

@matthewp
Copy link
Contributor

matthewp commented Oct 6, 2022

Fixed by #4888

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

5 participants