Here’s the build error on vercel.
on localhost, if I change the last line in the file
node_modules/@builder.io/dev-tools/next/index.d.ts
import type { NextConfig } from "next";
declare function NextBuilderDevTools(options?: {
enabled?: boolean;
devToolsServerPort?: number;
}): (config?: NextConfig) => NextConfig;
**export default NextBuilderDevTools;**
Only then, I can build.
I think it is the same issue.
NEXT_PUBLIC_BUILDER_API_KEY=7f4c484fcff442f99b4dc8edb17b8ccd
and this is the […page]/page.tsx
import { builder } from "@builder.io/sdk";
import { RenderBuilderContent } from "../../components/builder";
import Loading from "./loading";
import { Suspense } from "react";
// Builder Public API Key set in .env file
builder.init(process.env.NEXT_PUBLIC_BUILDER_API_KEY!);
type TPageParams = Promise<{ page: string[]; }>
export const revalidate = 60
export const dynamicParams = true // or false, to 404 on unknown paths
export async function generateStaticParams() {
const pages = await builder.getAll('page', {
options: {
noTargeting: true
}
});
// console.log('pages', pages);
return pages.map((page) => ({
page: page.data?.url?.split('/')?.slice(1) || [],
}));
}
export default async function Page({ params }: { params: TPageParams }) {
const builderModelName = "page";
// const params = await props?.params;
console.log("page params", params)
const {page} = await params;
const content = await builder
// Get the page content from Builder with the specified options
.get(builderModelName, {
userAttributes: {
// Use the page path specified in the URL to fetch the content
urlPath: (page?.join("/") || ""),
},
})
// Convert the result to a promise
.toPromise();
return (
<>
{/* Render the Builder page */}
<Suspense fallback={<Loading />}>
<RenderBuilderContent content={content} model={builderModelName} />
</Suspense>
</>
);
}
dev with nextjs 15.0.2
and package.json:
{
"name": "builder-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@builder.io/dev-tools": "^1.1.27",
"@builder.io/react": "^7.0.0",
"@builder.io/sdk": "^5.0.0",
"next": "15.0.2",
"react": "19.0.0-rc-02c0e824-20241028",
"react-dom": "19.0.0-rc-02c0e824-20241028"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "15.0.2",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
}