mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### Why? When Proxy/Middleware had invalid exports (valid: named function `proxy` for `proxy.js`, named function `middleware` for `middleware.js`, or default function), it errored during runtime but not during build. This error can sneak into production as it only throws during runtime. ### How? Walk AST of the Proxy/Middleware file, and if a valid export is not found, throw during build. --------- Co-authored-by: Benjamin Woodruff <[email protected]>
8 lines
123 B
JavaScript
8 lines
123 B
JavaScript
export default function () {}
|
|
|
|
const dynamicPath = `/:foobar`
|
|
|
|
export const config = {
|
|
matcher: ['/foo', dynamicPath],
|
|
}
|