next.js
91065e39 - fix(typed-routes): Fix route type fallback (#73271)

Commit
1 year ago
fix(typed-routes): Fix route type fallback (#73271) ### What? This PR updates the fallback type for typed routes to match the one in https://github.com/vercel/next.js/blob/canary/packages/next/src/types.ts#L58. ### Why? During builds, the `Route` type is initialized as the fallback type before being populated by the routes. This causes temporary type warnings in the project, since a route like `"" | Route` becomes `"" | string` which can raise an ts-eslint error like `"" is overridden by string in this union type`. This becomes a problem in both failed builds, and in CI where a linter and a build can run in parallel. Updating the type to match the stub type fixes the issue. Co-authored-by: Sam Ko <sam@vercel.com> Co-authored-by: JJ Kasper <jj@jjsweb.site>
Author
Parents
Loading