Skip to content

Add missing require shims #2047

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

Closed
orinokai opened this issue Apr 17, 2023 · 2 comments · Fixed by #2050
Closed

Add missing require shims #2047

orinokai opened this issue Apr 17, 2023 · 2 comments · Fixed by #2050
Assignees
Labels
type: bug code to address defects in shipped code

Comments

@orinokai
Copy link
Contributor

orinokai commented Apr 17, 2023

Next.js 13.3.1-canary.8 introduces a change to the fetch handling that uses the global Buffer object. This causes a runtime error because Buffer is not available in Deno.

@Skn0tt has commented on the PR, but until this is fixed (or assuming it won't be) we should implement a workaround by adding Buffer to our shims.

@orinokai orinokai changed the title Add shim for require (node:buffer) Add shim for Buffer Apr 17, 2023
@orinokai orinokai added the type: bug code to address defects in shipped code label Apr 17, 2023
@Skn0tt
Copy link
Contributor

Skn0tt commented Apr 17, 2023

Next.js 13.3.1-canary.8 introduces a change to the fetch handling that uses the global Buffer object. This causes a runtime error because Buffer is not available in Deno.

It doesn't use the global Buffer object, but require("node:buffer"). So if we shim something, we'll have to shim require - which sounds even worse than shimming globalThis.Buffer ...

@ascorbic
Copy link
Contributor

This is a lovely new feature from Turbopack vercel/turborepo#4368

@orinokai orinokai self-assigned this Apr 24, 2023
@kodiakhq kodiakhq bot closed this as completed in #2050 May 3, 2023
@nickytonline nickytonline changed the title Add shim for Buffer Add missing shims May 3, 2023
@nickytonline nickytonline changed the title Add missing shims Add missing require shims May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
3 participants