-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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: Some recently discovered type errors breaking build #18432
Conversation
…y undetected before)
@@ -20,7 +20,7 @@ const inputSchema = z.object({ | |||
cardKeys: z.array(z.string()), | |||
}); | |||
|
|||
export async function handler(request: Request) { | |||
async function handler(request: Request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Routes aren't allowed to export other functions than GET/POST/PUT..
@@ -33,7 +33,7 @@ const createI18nInstance = async (locale: string, ns: string) => { | |||
return _i18n; | |||
}; | |||
|
|||
const getTranslationWithCache = async (locale: string, ns: string = "common") => { | |||
const getTranslationWithCache = async (locale: string, ns = "common") => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ns: string = "common" resulted in a lint fail due to string being inferred.
@@ -1,4 +1,4 @@ | |||
import { PageProps } from "app/_types"; | |||
import type { PageProps } from "app/_types"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing type keyword.
@@ -1,6 +1,4 @@ | |||
import withEmbedSsrAppDir from "app/WithEmbedSSR"; | |||
import type { PageProps as _PageProps } from "app/_types"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused imports (@hbjORbj possibly a local lint issue?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I think, it's a lint issue.
@@ -76,6 +76,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo | |||
<script | |||
nonce={nonce} | |||
id="headScript" | |||
// eslint-disable-next-line react/no-danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was legit missing, but no idea how we missed this
@@ -1,3 +1,4 @@ | |||
import type { EmbedProps } from "app/WithEmbedSSR"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order incorrect.
@@ -14,7 +14,7 @@ import { Icon, TableNew, TableBody, TableCell, TableHead, TableHeader, TableRow | |||
|
|||
import { usePersistentColumnResizing } from "../lib/resizing"; | |||
|
|||
export interface DataTableProps<TData, TValue> { | |||
export type DataTableProps<TData, TValue> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT
@@ -89,7 +89,8 @@ export function DataTable<TData, TValue>({ | |||
usePersistentColumnResizing({ | |||
enabled: Boolean(enableColumnResizing), | |||
table, | |||
identifier, | |||
// TODO: Figure out why 'identifier' somehow types to string | null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eunjae-lee - this is a weird one; would love for you to have a looksy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on it !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the typedef from next.js seems to be weird.
Screenshot.2025-01-02.at.11.48.10.mp4
fixing it here:
c766694
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So usePathname is incorrectly typed? Is this a Nextjs version issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emrysal
I didn't dig deep enough, but the latest version seems to be the same.
The doc says it can return null
. As my video above shows, it has string
here and also string | null
there. Not sure how exactly the two different types emerge here.
https://nextjs.org/docs/app/api-reference/functions/use-pathname
Graphite Automations"Add foundation team as reviewer" took an action on this PR • (12/31/24)1 reviewer was added to this PR based on Keith Williams's automation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🙏 !!
E2E results are ready! |
(Haven't got a clue how this went undetected)
Detected async from #18431; but expands on it with additional lint/type fixes.
@cnhhoang850 for visibility; incorporates your detection also 🙏