[π Bug]: build error
next-on-pages environment related information
No response
Description
it buid is good yesterday, but it is error today, i do nothing of my code
this is the error
14:15:26.583 | β² ./src/app/[lang]/layout.tsx:89:14
-- | --
14:15:26.583 | β² Type error: 'Navbar' cannot be used as a JSX component.
14:15:26.583 | β² Its type '({ lang }: { lang: "zh"; }) => Promise<Element>' is not a valid JSX element type.
14:15:26.583 | β² Type '({ lang }: { lang: "zh"; }) => Promise<Element>' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
14:15:26.583 | β² Type 'Promise<Element>' is not assignable to type 'ReactNode'.
14:15:26.583 | β²
14:15:26.583 | β² 87 \| <div className="absolute inset-0 bg-gradient-radial-t from-primary/20 to-transparent pointer-events-none" />
14:15:26.583 | β² 88 \| <div className="absolute inset-0 bg-gradient-radial-b from-primary/20 to-transparent pointer-events-none" />
14:15:26.584 | β² > 89 \| <Navbar lang={lang} />
14:15:26.584 | β² \| ^
14:15:26.584 | β² 90 \| <main className="relative flex-1">
14:15:26.584 | β² 91 \| <BreadcrumbWrapper lang={lang} dict={dict} />
14:15:26.584 | β² 92 \| {children}
14:15:26.630 | β² Error: Command "npm run build" exited with 1
Reproduction
No response
Pages Deployment Method
None
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
- [ ] Would you like to help fixing this bug?
Hi @zhugezifang π π
Thank you very much for the issue, unfortunately I did try to create a new application and did not encounter this problem
So I'm afraid that the logs you shared are not enough to understand what's going on here (those logs seem to come from the vercel build command, so it feel like it might even be unrelated to next-on-pages...?)
Could you please provide more details and ideally a minimal reproduction for the issue?
How are you deploying you application? can you run the build and preview the application locally?
Any info here would be very useful π
We had the same issue but i was able to get it to work again.
I think it was because the cf build wasn't using our pnpm lockfile. Please check your npm/pnpm/yarn install logs and see if the correct package manager version is used and that it's installing from lockfile.
e.g. we saw the following while developing with pnpm@9. It said that pnpm 8 will be used and all locked dependencies ignored. I guess then some weird typedef combination got picked.
17:51:58.871 | Preparing [email protected] for immediate activation...
-- | --
17:52:00.515 | ! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing [email protected]+sha512.41bb77121614697152da4e052d003baf6fde633fc9a03786ebcd3fdd45c6d066b4dcb3ee6381a076f08b7beccedcced99d61b8548e1b03093b4292727ebe5ea8.
17:52:00.516 | ! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager
17:52:00.516 | Β
17:52:00.955 | Installing project dependencies: pnpm install
17:52:01.613 | WARNβ Ignoring not compatible lockfile at /opt/buildhome/repo/pnpm-lock.yaml
Adding the packageManager field to our package.json fixed it, e.g.
"packageManager": "[email protected]+sha256.2ef6e547b0b07d841d605240dce4d635677831148cd30f6d564b8f4f928f73d2",
No idea why it happened now but it prob means that we just were incredibly lucky that the "unlocked" dependencies, that pnpm installed, didn't break anything. Just now some dependency introduced a breaking change from Thursday to Friday which made this noticeable.
Feels a bit weird that it's actually completing the install step without throwing an error if the lockfile can't be used.
Hello π
Earlier this year we released our Cloudflare adapter for OpenNext, and we have been continuously investing effort in its improvement since then. Existing deployments can continue to use the next-on-pages tooling, but the Cloudflare adapter for OpenNext is currently stable and recommended for deployment of Next.js applications to Cloudflare.
As such, we will no longer be maintaining next-on-pages. We recently deprecated the package on npm and we plan to archive this repo on Monday Sep 29, 2025. In preparation for archival, we are closing all open issues and PRs.
If you have concerns, please feel free to reply here before the repo is archived (after that, it will no longer be possible to comment) or to reach out to our team on Discord.
Thanks so much for using and contributing to next-on-pages π§‘