Calling CreateServer (/next/dist/server/next.d.ts) cannot return NextServer object after 13.4.3 #52886
Replies: 4 comments 1 reply
-
I believe this is the place things changed next.js/packages/next/src/server/next.ts Line 281 in 5e36c34 Presumably changed after this difF: |
Beta Was this translation helpful? Give feedback.
-
Taking a look at the current status of this issue, it all seems to be related to whatever or not the The following code change fixes this issue: diff --git a/packages/next/src/server/next.ts b/packages/next/src/server/next.ts
index fabcea9..b6416ef 100644
--- a/packages/next/src/server/next.ts
+++ b/packages/next/src/server/next.ts
@@ -413,10 +413,16 @@ function createServer(options: NextServerOptions): NextServer {
}
}
default: {
- const method = server[propKey as keyof NextServer]
- if (typeof method === 'function') {
- return method.bind(server)
+ const methodOrProperty = server[propKey as keyof NextServer]
+ if (typeof methodOrProperty === 'function') {
+ return methodOrProperty.bind(server)
}
+ return methodOrProperty
}
}
}, Unfortunately, this change isn't enough, the proxy overrides the Could we get some input from a project maintainer such as @shuding or @ijjk? (both have recently modified this file, and @shuding introduced the proxy return) |
Beta Was this translation helpful? Give feedback.
-
Any updates? |
Beta Was this translation helpful? Give feedback.
-
It's going on, it's forcing to use low version |
Beta Was this translation helpful? Give feedback.
-
Verify canary release
Provide environment information
Which example does this report relate to?
n/a
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
My project is setup with nest.js 10, next.js, and bridged with nest-next.
In this function imports
inside below, The Next({ dev: true }) param is good because it is able to return a NextServer object in the file:
/node_modules/next/dist/server/next.d.ts
But this is not after version next 13.4.3
Expected Behavior
The CreateServer function inside should return a NextServer object.
/config/workspace/vm/js/NxTime/node_modules/next/dist/server/next.d.ts
To Reproduce
Create a empty nest project
add Next.js 13.4.2 in the project
In the main.ts, import Next and log the object by calling "Next" like below
With Next version: 13.4.2 or lower, the above log will report
With Next version >=13.4.3
the app object is logged as {}
Beta Was this translation helpful? Give feedback.
All reactions