You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Need to override the require hooks for React before Next.js server
39
-
// overrides them with prebundled ones in the case of app dir
41
+
// WORKAROUND: Set `__NEXT_PRIVATE_PREBUNDLED_REACT` to use prebundled React — https://github.com/serverless-stack/open-next#workaround-set-__next_private_prebundled_react-to-use-prebundled-react
42
+
// Step 1: Need to override the require hooks for React before Next.js server
43
+
// overrides them with prebundled ones in the case of app dir
44
+
// Step 2: Import Next.js server
45
+
// Step 3: Apply the override after Next.js server is imported since the
46
+
// override that Next.js does is done at import time
@@ -135,28 +143,16 @@ function setNextjsServerWorkingDirectory() {
135
143
process.chdir(__dirname);
136
144
}
137
145
138
-
functionoverrideNextjsRequireHooks(config: any){
139
-
// WORKAROUND: Set `__NEXT_PRIVATE_PREBUNDLED_REACT` to use prebundled React — https://github.com/serverless-stack/open-next#workaround-set-__next_private_prebundled_react-to-use-prebundled-react
140
-
try{
141
-
overrideDefault();
142
-
overrideReact(config);
143
-
}catch(e){
144
-
console.error("Failed to override Next.js require hooks.",e);
// WORKAROUND: Set `__NEXT_PRIVATE_PREBUNDLED_REACT` to use prebundled React — https://github.com/serverless-stack/open-next#workaround-set-__next_private_prebundled_react-to-use-prebundled-react
0 commit comments