...Error: Failed to load chunk server/chunks/ssr/[root-of-the-server]
Unanswered
Transvaal lion posted this in #help-forum
Transvaal lionOP
Working fine in dev but build is failing can someone please help ?
import { auth } from "@/lib/auth";
import { headers } from "next/headers";
import { redirect } from "next/navigation";
import { Suspense } from "react";
export default async function AuthLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<div className="bg-background flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
<div className="flex w-full max-w-sm flex-col gap-6">
<Suspense>
<DynamicContent children={children} />
</Suspense>
</div>
</div>
);
}
async function DynamicContent({ children }) {
const session = await auth.api.getSession({
headers: await headers(),
});
if (session) redirect("/");
return children;
}7 Replies
Transvaal lionOP
I am using nextjs 16 with cacheComponents enabled
whats the error log? more information please?
Transvaal lionOP
harshmangalam@Harshs-MacBook-Air groupvoyage % bun run build
$ bun --bun next build
▲ Next.js 16.0.1 (Turbopack, Cache Components)
- Environments: .env
Creating an optimized production build ...
✓ Compiled successfully in 3.8s
✓ Finished TypeScript in 4.3s
Collecting page data ..Error: Failed to load chunk server/chunks/ssr/[root-of-the-server]__b20f0d68._.js from runtime for chunk server/app/(auth)/signup/page.js
at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19)
at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9)
at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25)
at <anonymous> (.next/server/app/(auth)/signup/page.js:23:3)
at anonymous (null)
at processTicksAndRejections (null) {
[cause]: ResolveMessage {}
}
> Build error occurred
Error: Failed to collect page data for /signup
at processTicksAndRejections (null) {
type: 'Error'
}
error: "next" exited with code 1
error: script "build" exited with code 1Dutch
is it okay with NPM
Transvaal lionOP
Yup working fine with npm/pnpm
I created issues in bun repo
for now switched to pnpm