8000 next v15 error build for "examples/nextjs-starter/frontend" · Issue #222 · encoredev/examples · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

next v15 error build for "examples/nextjs-starter/frontend" #222

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

Open
Ales999 opened this issue Mar 23, 2025 · 0 comments
Open

next v15 error build for "examples/nextjs-starter/frontend" #222

Ales999 opened this issue Mar 23, 2025 · 0 comments

Comments

@Ales999
Copy link
Ales999 commented Mar 23, 2025

Hi.

If using next build from 'https://github.com/encoredev/examples/tree/main/nextjs-starter/frontend' - error build

$ next build
   ▲ Next.js 15.2.3

   Creating an optimized production build ...
 ✓ Compiled successfully
   Linting and checking validity of types  ...Failed to compile.

app/users/[id]/page.tsx
Type error: Type '{ params: { id: string; }; }' does not satisfy the constraint 'PageProps'.
  Types of property 'params' are incompatible.
    Type '{ id: string; }' is missing the following properties from type 'Promise<any>': then, catch, finally, [Symbol.toStringTag]

Next.js build worker exited with code: 1 and signal: null
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Possible fast fix:

import getRequestClient from "@/app/lib/getRequestClient";
//import { APIError } from "@/app/lib/client";

type Props = {
  searchParams: Promise<{ [key: string]: string }>;
};

export default async function UserDetails({
  searchParams,
}: Props) {
  
  const client = getRequestClient();
  const { id } = await searchParams;
  const response = await (await client).user.GetUser(id);

  return (
    <section>
      <h1>Detail for {response.user.name}</h1>
      <p>ID: {response.user.id}</p>
    </section>
  );
}

Using this reference for fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0