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

Edge runtime error: Buffer is not defined #4323

Closed
1 task done
RoyalIcing opened this issue Aug 15, 2022 · 3 comments · Fixed by #4324
Closed
1 task done

Edge runtime error: Buffer is not defined #4323

RoyalIcing opened this issue Aug 15, 2022 · 3 comments · Fixed by #4324
Assignees
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)

Comments

@RoyalIcing
Copy link
Contributor

What version of astro are you using?

1.0.5

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

Deno

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

When deploying to Deno Deploy or running locally with Deno, I receive this error:

Server running on port 8085
01:43:51 pm [ssr] ReferenceError: Buffer is not defined
    at renderPage (file:///Users/pgwsmith/Royal%20Icing/regenerated-astro/dist/server/entry.mjs:5767:28)
    at async render (file:///Users/pgwsmith/Royal%20Icing/regenerated-astro/dist/server/entry.mjs:6560:10)
    at async App.renderPage_fn (file:///Users/pgwsmith/Royal%20Icing/regenerated-astro/dist/server/entry.mjs:7499:22)
    at async App.render (file:///Users/pgwsmith/Royal%20Icing/regenerated-astro/dist/server/entry.mjs:7451:22)
    at async Server.handler (file:///Users/pgwsmith/Royal%20Icing/regenerated-astro/dist/server/entry.mjs:7580:14)
    at async Server.#respond (https://deno.land/[email protected]/http/server.ts:298:18)

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-tdn4cu?file=package.json

Participation

  • I am willing to submit a pull request for this issue.
@QuiiBz
Copy link
Contributor

QuiiBz commented Aug 15, 2022

I've encountered the same error when targeting any edge runtime (discussion on the Discord). Looking at the docs of cloudflare workers and deno deploy, none of them provides an API for Buffer which makes sense since it's a node-specific API.

I initially found this error while testing on my edge runtime (https://github.com/lagonapp/lagon), so maybe we should rename the issue and PR to be about "any edge runtime" instead of specifically deno?

@natemoo-re natemoo-re changed the title Deno error — Buffer is not defined Edge runtime error: Buffer is not defined Aug 15, 2022
@natemoo-re natemoo-re added the - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) label Aug 15, 2022
@natemoo-re
Copy link
Member

Thanks for opening an issue! I will take a look at the PR you submitted, really appreciate it!

@natemoo-re natemoo-re self-assigned this Aug 15, 2022
@FredKSchott
Copy link
Member

Note for PR (or followup PR): Can we make sure that this code path is hit inside of our Deno test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants