Type Mismatch Issue due to NextJs15 instead of 14.
Thanks for your help!
Here is the syntax that is cause issues, and the error I'm running into.
Code Syntax - from the AI Marketing Platform App.
api -> projects -> [projectId] -> asset-processing-jobs -> route.ts
-------------------------------------------------
export async function GET(
request: NextRequest,
{ params }: { params: { projectId: string } }
) {
try {
const { projectId } = params;
// Auth check
...
-----------------------------------------------
Here is the error I get when I 'yarn build' this equivalent code in my app.
----------------------------------------------
PS C:\Users\adamn\GitHub Repos\GameMaister\game-maister> yarn build
yarn run v1.22.22
$ next build
▲ Next.js 15.0.3
- Environments: .env
Creating an optimized production build ...
✓ Compiled successfully
Linting and checking validity of types .Failed to compile.
.next/types/app/api/campaigns/[campaignId]/asset-processing-jobs/route.ts:49:7
Type error: Type '{ __tag__: "GET"; __param_position__: "second"; __param_type__: { params: { campaignId: string; }; }; }' does not sat
Type error: Type '{ __tag__: "GET"; __param_position__: "second"; __param_type__: { params: { campaignId: string; }; }; }' does not satisfy the constraint 'ParamCheck<RouteContext>'.
The types of '__param_type__.params' are incompatible between these types.
Type '{ campaignId: string; }' is missing the following properties from type 'Promise<any>': then, catch, finally, [Symbol.toString
Type '{ campaignId: string; }' is missing the following properties from type 'Promise<any>': then, catch, finally, [Symbol.toStringTag]
47 | Diff<
48 | ParamCheck<RouteContext>,
> 49 | {
| ^
50 | __tag__: 'GET'
51 | __param_position__: 'second'
52 | __param_type__: SecondArg<MaybeField<TEntry, 'GET'>>
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
1
4 comments
Adam Hanson
2
Type Mismatch Issue due to NextJs15 instead of 14.
AI Developer Accelerator
skool.com/ai-developer-accelerator
Master AI & software development to build apps and unlock new income streams. Transform ideas into profits. 💡➕🤖➕👨‍💻🟰💰
Leaderboard (30-day)
powered by