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

Build edge/worker runtime with webworker ssr target #7101

Merged
merged 2 commits into from May 17, 2023
Merged

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented May 16, 2023

Changes

Part of the fix for #6989

The solid integration was setting the SSR target to node, but in a Cloudflare / Vercel edge setup, it should be webworker. This PR fixes that.

Also fixes a missing esbuild dep in @astrojs/vercel

Testing

Manually tested with the PR repro.

Docs

n/a. bug fix.

@changeset-bot
Copy link

changeset-bot bot commented May 16, 2023

🦋 Changeset detected

Latest commit: 411c5d1

The changes in this PR will be included in the next version bump.

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

@github-actions github-actions bot added pkg: solid Related to Solid (scope) pkg: integration Related to any renderer integration (scope) labels May 16, 2023
@bluwy bluwy merged commit 2994bc5 into main May 17, 2023
14 checks passed
@bluwy bluwy deleted the fix-solid-build branch May 17, 2023 07:44
@astrobot-houston astrobot-houston mentioned this pull request May 17, 2023
@davycoe
Copy link

davycoe commented May 18, 2023

Hey this update seems to have killed graphql-request from making API calls once deployed to cloudflare.
If I roll back the following @astrojs/cloudflare 6.3.0 > 6.2.4 / @astrojs/solid-js 2.2.0 > 2.1.1 it works.

Will this be a problem with other libs targeting node that worked pre SSR target change?

@bluwy
Copy link
Member Author

bluwy commented May 19, 2023

@davycoe sorry for the breaking change. It's tough to prevent it since it involves two packages that does separate things, and it was unfortunately coupled before that made it worked.

The new behaviour now is technically correct though since bundling for Cloudflare, we shouldn't target node following Cloudflare's runtime standard. It should also allow libraries that didn't work before to work now.

You could perhaps try adding the problematic packages to config.vite.ssr.noExternal in the astro config to workaround things, but it would be best to figure what packages are having trouble with Cloudflare specifically.

@davycoe
Copy link

davycoe commented May 19, 2023

I've worked out that the way environment variables were imported previously must have changed in the last update, due to not getting errors regarding my token my initial assumption was wrong!

Sorry for wasting your time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope) pkg: solid Related to Solid (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants