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

fix buildToNodeHandler, refactor node <-> edge bridge code #16

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

mxsdev
Copy link
Contributor

@mxsdev mxsdev commented Jan 15, 2024

This PR fixes buildToNodeHandler by introducing a workaround for vercel/edge-runtime#716 (see here)

Then I've used this wherever we've manually written code that bridges edge runtime with node. The result is significantly cleaner and probably much less error prone 😉

cc @seveibar

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 !!!

@mxsdev mxsdev merged commit d072eba into main Jan 16, 2024
})
res.end(await fetchResponse.text())
})
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should have been documented better, but we don't want to run within the edge runtime here--this is for when you're targeting Node, either because you want to use Node APIs or you're unable to use the edge runtime (I think you might not be allowed to use it in Vercel endpoints)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see! I'll revert this in a future pr 👍

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

Successfully merging this pull request may close these issues.

3 participants