Skip to content
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

fix(typed-routes): Fix route type fallback #73271

Merged
merged 6 commits into from
Dec 19, 2024
Merged

fix(typed-routes): Fix route type fallback #73271

merged 6 commits into from
Dec 19, 2024

Conversation

alitas
Copy link
Contributor

@alitas alitas commented Nov 27, 2024

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.

@ijjk
Copy link
Member

ijjk commented Nov 27, 2024

Allow CI Workflow Run

  • approve CI run for commit: 50b7c96

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@samcx samcx self-requested a review December 6, 2024 23:23
@ijjk ijjk enabled auto-merge (squash) December 19, 2024 03:05
@ijjk ijjk merged commit 91065e3 into vercel:canary Dec 19, 2024
103 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants