-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
bug?: new MiddlewareConfig
type doesn't match runtime behavior and docs
#61705
bug?: new MiddlewareConfig
type doesn't match runtime behavior and docs
#61705
Comments
Reproduction repo if needed: https://github.com/juliusmarminge/next-auth-type-mismatch Output of Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000
Binaries:
Node: 20.11.0
npm: 10.2.4
Yarn: 1.22.19
pnpm: 8.13.1
Relevant Packages:
next: 14.1.1-canary.36 // Latest available version is detected (14.1.1-canary.36).
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 5.3.3
Next.js Config:
output: N/A |
### What? Fix the user-facing `MiddlewareConfig` interface. ~While in the codebase, I also made the incoming config object type a bit more strict by converting from `any` to `unknown`.~ Reverted, as we do a config assertion already in a [different place](https://github.com/vercel/next.js/blob/canary/packages/next-swc/crates/next-custom-transforms/src/transforms/page_config.rs/#L171-L180). ### Why? The interface we previously exposed was the one we used internally, _after_ we did some parsing on the config object, which is different from what the user is expected to pass. ### How? I separated the internal type to its own `MiddlewareConfigParsed` interface. Closes NEXT-2375 Fixes #61705 Ref: #61576
@balazsorban44 This is still not fixed. The interface Following the types results in Next.js dying with the following error message:
|
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Originally posted by @juliusmarminge in #61576 (comment)
NEXT-2375
The text was updated successfully, but these errors were encountered: