I am having challenges deploying my first Next JS project. There are linting issues, please help.
Here’s a summary of the linting and type errors you are facing with deployment in your Next.js 15 project:
- Type Error in Dynamic Route Page ([slug]/page.tsx)
-Error Message:
Type error: Type 'Props' does not satisfy the constraint 'PageProps'.
Types of property 'params' are incompatible.
Type '{ slug: string; }' is missing the following properties from type 'Promise<any>': then, catch, finally, [Symbol.toStringTag]
-
Cause:
Next.js 15’s type system for dynamic routes is currently too strict and mismatches the actual runtime props. Even when using the canonical template from the documentation, the build fails with this type error. -
Impact:
- This error appears during the build process.
- It does not affect the runtime or the actual deployment.
- There is currently no clean workaround except to wait for a Next.js fix or downgrade to Next.js 14.
- Linting Error: Unused
searchParamsParameter
-
Error Message:
'searchParams' is defined but never used. @typescript-eslint/no-unused-vars -
Cause:
Next.js expects thesearchParamsprop to be present for dynamic route pages, but if you don’t use it, ESLint complains about it being unused. -
Workaround:
- You can suppress this warning with
// eslint-disable-next-line @typescript-eslint/no-unused-varsabove the parameter. - This keeps the code clean and allows the build to proceed (except for the type error above).
- You can suppress this warning with
- Suppression Comments Not Fully Effective
- Issue:
Attempts to suppress the type error with@ts-expect-erroror@ts-ignoreare flagged by the linter as “Unused ‘@ts-expect-error’ directive” because the error is only present during the Next.js build, not during regular TypeScript linting.
Summary Table
| Error Type | Message/Rule | Impact on Deployment | Workaround/Status |
|---|---|---|---|
| Type Error | Type ‘Props’ does not satisfy ‘PageProps’ | Build fails, site works | Wait for Next.js fix or downgrade |
| Linting Error | ‘searchParams’ is defined but never used | Lint fails, site works | Use eslint-disable-next-line |
| Suppression Error | Unused ‘@ts-expect-error’ directive | Lint fails, site works | No clean workaround |
Bottom Line
- The only blocking error for deployment is the Next.js type error during build.
- Your code is correct and matches the official docs.
- The site will work at runtime, but the build will fail until Next.js fixes this type system bug.
If you need a temporary workaround for CI/CD or want to explore downgrading to Next.js 14, let me know!