diff --git a/apps/dashboard/src/app/(main)/handler/[...stack]/page.tsx b/apps/dashboard/src/app/(main)/handler/[...stack]/page.tsx
index d66bfd5c3..42f061476 100644
--- a/apps/dashboard/src/app/(main)/handler/[...stack]/page.tsx
+++ b/apps/dashboard/src/app/(main)/handler/[...stack]/page.tsx
@@ -2,7 +2,7 @@ import { StackHandler } from "@stackframe/stack";
import { stackServerApp } from "@/stack";
import { StyledLink } from "@/components/link";
-export default function Handler(props: any) {
+export default function Handler(props: unknown) {
const extraInfo = <>
By signing in, you agree to the
Terms of Service and Privacy Policy
diff --git a/docs/fern/docs/pages/getting-started/setup.mdx b/docs/fern/docs/pages/getting-started/setup.mdx
index 868fbac38..e93f26844 100644
--- a/docs/fern/docs/pages/getting-started/setup.mdx
+++ b/docs/fern/docs/pages/getting-started/setup.mdx
@@ -85,7 +85,7 @@ We recommend using our **setup wizard**, which will automatically detect your pr
import { StackHandler } from "@stackframe/stack";
import { stackServerApp } from "@/stack";
- export default function Handler(props: any) {
+ export default function Handler(props: unknown) {
return ;
}
```
diff --git a/packages/init-stack/index.mjs b/packages/init-stack/index.mjs
index cf4dbbdde..18bf62ba8 100644
--- a/packages/init-stack/index.mjs
+++ b/packages/init-stack/index.mjs
@@ -232,7 +232,7 @@ async function main() {
await writeFileIfNotExists(
handlerPath,
`import { StackHandler } from "@stackframe/stack";\nimport { stackServerApp } from "../../../stack";\n\nexport default function Handler(props${
- handlerFileExtension.includes("ts") ? ": any" : ""
+ handlerFileExtension.includes("ts") ? ": unknown" : ""
}) {\n${ind}return ;\n}\n`
);
await writeFileIfNotExists(
diff --git a/packages/stack/src/components-page/stack-handler.tsx b/packages/stack/src/components-page/stack-handler.tsx
index a3cd4084a..dfa407536 100644
--- a/packages/stack/src/components-page/stack-handler.tsx
+++ b/packages/stack/src/components-page/stack-handler.tsx
@@ -44,20 +44,20 @@ export default async function StackHandler(props:
} & (
| Partial
| {
- routeProps: RouteProps,
+ routeProps: RouteProps | unknown,
}
)): Promise {
if (!("routeProps" in props)) {
console.warn(next15DeprecationWarning);
}
- const routeProps = "routeProps" in props ? props.routeProps : pick(props, ["params", "searchParams"] as any);
+ const routeProps = "routeProps" in props ? props.routeProps as RouteProps : pick(props, ["params", "searchParams"] as any);
const params = await routeProps.params;
const searchParams = await routeProps.searchParams;
if (!params?.stack) {
return (
- Can't use {""} at this location. Make sure that the file is in a folder called [...stack].
+ Can't use {""} at this location. Make sure that the file is in a folder called [...stack] and you are passing the routeProps prop.
);
}