Skip to content

Commit 35ec70d

Browse files
committed
fix(studio): accept .next/dev/types include and fix type errors surfaced by App Router typegen
1 parent 2297a3d commit 35ec70d

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

apps/studio/components/grid/SupabaseGrid.utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ export function useSyncTableEditorStateFromLocalStorageWithUrl({
242242
// Use nextjs useSearchParams to get the latest URL params
243243
const searchParams = useSearchParams()
244244
const urlParams = useMemo(() => {
245-
const sort = searchParams.getAll('sort')
246-
const filter = searchParams.getAll('filter')
245+
const sort = searchParams?.getAll('sort') ?? []
246+
const filter = searchParams?.getAll('filter') ?? []
247247
return { sort, filter }
248248
}, [searchParams])
249249

apps/studio/components/layouts/ProjectLayout/UpgradingState/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const UpgradingState = () => {
3636
{
3737
projectRef: ref,
3838
projectStatus: project?.status,
39-
trackingId: queryParams.get('trackingId'),
39+
trackingId: queryParams?.get('trackingId'),
4040
},
4141
{
4242
enabled: IS_PLATFORM,

apps/studio/pages/project/[ref]/sql/quickstarts.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { NextPageWithLayout } from 'types'
1212

1313
const SqlQuickstarts: NextPageWithLayout = () => {
1414
const router = useRouter()
15-
const { ref } = useParams<{ ref: string }>()
15+
const ref = useParams<{ ref: string }>()?.ref
1616
const tabs = useTabsStateSnapshot()
1717

1818
useEffect(() => {

apps/studio/pages/project/[ref]/sql/templates.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { NextPageWithLayout } from 'types'
1212

1313
const SqlTemplates: NextPageWithLayout = () => {
1414
const router = useRouter()
15-
const { ref } = useParams<{ ref: string }>()
15+
const ref = useParams<{ ref: string }>()?.ref
1616
const tabs = useTabsStateSnapshot()
1717

1818
useEffect(() => {

apps/studio/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"**/*.js",
3737
"**/*.jsx",
3838
".next/types/**/*.ts",
39-
"./../../packages/ui/src/**/*.d.ts"
39+
"./../../packages/ui/src/**/*.d.ts",
40+
".next/dev/types/**/*.ts"
4041
],
4142
"exclude": ["node_modules", "public/deno/*.ts"]
4243
}

0 commit comments

Comments
 (0)