mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What Disable auto polyfill for process in edge runtime. ### Why React uses process.emit behind a typeof guard now. This leads to process being bundled and process.emit being called which triggers build warnings since we stub process APIs since they're not supported in Edge runtime. There's condition like `"object" === typeof process && "function" === typeof process.emit` in the react build now where the 2nd condition is falsy. Stop polyfilling to skip that condition since it's mainly for Node.js runtime Related to #65692
18 lines
310 B
TypeScript
18 lines
310 B
TypeScript
import React from 'react'
|
|
|
|
export default function Page() {
|
|
return (
|
|
<>
|
|
<p id="process">
|
|
{typeof process === 'object'
|
|
? typeof process.emit === 'function'
|
|
? 'emit'
|
|
: 'object'
|
|
: 'undefined'}
|
|
</p>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export const runtime = 'edge'
|