-
Notifications
You must be signed in to change notification settings - Fork 26k
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
When middleware.ts
is specified, runtime is set to edge
instead of node
#48638
Comments
The issues people have in #48302 are probably caused by this as well, as the libraries people use in their middlewares that have the same problem differ. It's worth mentioning that a part of the issue here is also that the |
I thought I fixed this a few months ago, perhaps something went wrong... Time to check :) Edit: this is weird, seems that this no longer works... I'm on it :) Edit 2: ah, it was never fixed for middleware... |
@ecumene |
@wowczarczyk no, but it is related to Defrosted's comment. |
OK, cool, for now I added additional COPY statement in my Dockerfile to mitigate this:
|
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103 Binaries: Node: 19.8.1 npm: 9.5.1 Yarn: 1.22.19 pnpm: N/A Relevant packages: next: 13.3.1-canary.16 eslint-config-next: 13.3.0 react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
Middleware / Edge (API routes, runtime)
Link to the code that reproduces this issue
https://github.com/ecumene/next-reproduce-edge-middleware
To Reproduce
yarn build
.next
project is built for a node runtime (Compatible with SST in my case)middleware.ts
file.next
project is built for an edge runtime (Incompatible with SST)Describe the Bug
An
edge-runtime-webpack.js
file is present in.next
when it shouldn't be there.Expected Behavior
The project should be built for a node runtime.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
SST
The text was updated successfully, but these errors were encountered: