Node_modules/@builder.io/dev-tools/next/index"' has no default export

Trying to use nextjs 15 with SSR with builder.io. When npm run build, it throws error
node_modules/@builder.io/dev-tools/next/index"’ has no default export.

This is the next.config.ts

import BuilderDevTools from "@builder.io/dev-tools/next";
import type { NextConfig } from "next";

const nextConfig: NextConfig = BuilderDevTools()({
  /* config options here */
});

export default nextConfig;

and then in builder package file

import type { NextConfig } from "next";

declare function NextBuilderDevTools(options?: {
  enabled?: boolean;
  devToolsServerPort?: number;
}): (config?: NextConfig) => NextConfig;

export = NextBuilderDevTools;

It can sort of build when changing
export = NextBuilderDevTools;
to
export default NextBuilderDevTools;

So this will fail to build at all on vercel other than my localhost. Any help?

Code stack you are integrating Builder with
. NextJS, react

Hello @Mitch,

Welcome to the Builder.io forum!

We attempted to reproduce the issue you reported using the developer tools; however, we were unsuccessful. Could you please share a minimum reproducible example with us? This will help us investigate the issue further.

Best regards,

I believe this looks similar to my issue, Builder.io/dev-tools/next has no default export - error with Nextjs 15

Hello @Mitch,

Could you please check the forum post by @jasperkooij and confirm if it matches the issue you are experiencing?

Regarding the issue reported by @jasperkooij, we already have a ticket for our team to investigate the issue further.

Thank you, @jasperkooij, we appreciate your input.

1 Like


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"
  }
}

Hello @Mitch,

Thank you for the details. So, this is a known issue, and we will inform you once we have an update on the fix.

Thanks,

Appreciate if this can be fixed sooner coz I’m working on a proof of concept for client and this is a blocker right now.

Hello @Mitch,

We understand the urgency of this matter and are actively working with our internal team to prioritize and address the issue. We hope to have an update for you soon.

Thank you for your patience.

Best regards,

Hi all-
I also ran into this issue earlier this week when trying to initialize a typescript project. I didn’t get the same issue when I initiated a project not using typescript but then added in typescript after the fact if that helps anyone as a workaround while this issue is being fixed.

Hello @jhs129, @Mitch,

I wanted to update you that a fix has been deployed to improve dev-tools support with Next.js 15. The issue with the default export error should now be resolved. Please verify the changes and let us know if you encounter any further issues.

Best regards,

hi @manish-sharma ,
do u know which particular version of next js 15 will work with?

when I remove the previous node_modules folder and npm i again, I got the following:

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @emotion/core@10.3.1
npm WARN Found: react@19.0.0-rc-66855b96-20241106
npm WARN node_modules/react
npm WARN   react@"19.0.0-rc-66855b96-20241106" from the root project
npm WARN   4 more (@builder.io/react, next, react-dom, styled-jsx)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@">=16.3.0" from @emotion/core@10.3.1
npm WARN node_modules/@builder.io/react/node_modules/@emotion/core
npm WARN   @emotion/core@"^10.0.17" from @builder.io/react@7.0.1
npm WARN   node_modules/@builder.io/react
npm WARN 
npm WARN Conflicting peer dependency: react@18.3.1
npm WARN node_modules/react
npm WARN   peer react@">=16.3.0" from @emotion/core@10.3.1
npm WARN   node_modules/@builder.io/react/node_modules/@emotion/core
npm WARN     @emotion/core@"^10.0.17" from @builder.io/react@7.0.1
npm WARN     node_modules/@builder.io/react
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

and npm run dev will not display correctly due to errors

○ Compiling /_error ...
 ✓ Compiled /_error in 1445ms (975 modules)
 GET / 500 in 4093ms
 ⨯ node_modules/@builder.io/react/node_modules/@emotion/core/dist/emotion-element-39b82f0b.esm.js (10:53) @ eval
 ⨯ TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_1__.createContext) is not a function
    at (rsc)/./node_modules/@builder.io/react/node_modules/@emotion/core/dist/emotion-element-39b82f0b.esm.js (/Users/mitch/Development/github/builder-app/.next/server/vendor-chunks/@builder.io.js:80:1)
    at __webpack_require__ (/Users/mitch/Development/github/builder-app/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///(rsc)/./node_modules/@builder.io/react/node_modules/@emotion/core/dist/core.esm.js:17:90)
    at (rsc)/./node_modules/@builder.io/react/node_modules/@emotion/core/dist/core.esm.js (/Users/mitch/Development/github/builder-app/.next/server/vendor-chunks/@builder.io.js:70:1)
    at __webpack_require__ (/Users/mitch/Development/github/builder-app/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///(rsc)/./node_modules/@builder.io/react/dist/builder-react.es5.js:49:71)
    at (rsc)/./node_modules/@builder.io/react/dist/builder-react.es5.js (/Users/mitch/Development/github/builder-app/.next/server/vendor-chunks/@builder.io.js:60:1)
    at __webpack_require__ (/Users/mitch/Development/github/builder-app/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///(rsc)/./components/ProductList/ProductList.tsx:10:75)
    at (rsc)/./components/ProductList/ProductList.tsx (/Users/mitch/Development/github/builder-app/.next/server/app/page.js:387:1)
    at __webpack_require__ (/Users/mitch/Development/github/builder-app/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///(rsc)/./app/page.tsx:10:93)
    at (rsc)/./app/page.tsx (/Users/mitch/Development/github/builder-app/.next/server/app/page.js:376:1)
    at Function.__webpack_require__ (/Users/mitch/Development/github/builder-app/.next/server/webpack-runtime.js:33:42)
    at async getLayoutOrPageModule (webpack://next/dist/src/server/lib/app-dir-module.ts:29:10)
    at async createComponentTreeInternal (webpack://next/dist/src/server/app-render/create-component-tree.tsx:166:35)
    at async (webpack://next/dist/src/server/app-render/create-component-tree.tsx:406:27)
    at async createComponentTreeInternal (webpack://next/dist/src/server/app-render/create-component-tree.tsx:337:27)
    at async getRSCPayload (webpack://next/dist/src/server/app-render/app-render.tsx:731:19)
    at async renderToStream (webpack://next/dist/src/server/app-render/app-render.tsx:1656:25)
    at async renderToHTMLOrFlightImpl (webpack://next/dist/src/server/app-render/app-render.tsx:1353:19)
    at async doRender (node_modules/next/src/server/base-server.ts:2666:21)
    at async responseGenerator (node_modules/next/src/server/base-server.ts:3027:21)
    at async DevServer.renderToResponseWithComponentsImpl (node_modules/next/src/server/base-server.ts:3039:23)
    at async DevServer.renderPageComponent (node_modules/next/src/server/base-server.ts:3597:15)
    at async DevServer.renderToResponseImpl (node_modules/next/src/server/base-server.ts:3659:23)
    at async DevServer.pipeImpl (node_modules/next/src/server/base-server.ts:1698:20)
    at async NextNodeServer.handleCatchallRenderRequest (node_modules/next/src/server/next-server.ts:1034:6)
    at async DevServer.handleRequestImpl (node_modules/next/src/server/base-server.ts:1462:8)
    at async (node_modules/next/src/server/dev/next-dev-server.ts:514:13)
    at async Span.traceAsyncFn (node_modules/next/src/trace/trace.ts:143:13)
    at async DevServer.handleRequest (node_modules/next/src/server/dev/next-dev-server.ts:512:19)
    at async invokeRender (node_modules/next/src/server/lib/router-server.ts:284:10)
    at async handleRequest (node_modules/next/src/server/lib/router-server.ts:530:15)
    at async requestHandlerImpl (node_modules/next/src/server/lib/router-server.ts:576:6)
    at async Server.requestListener (node_modules/next/src/server/lib/start-server.ts:146:6)
  27 |     filePath = layout[1]
  28 |   } else if (isPage) {
> 29 |     mod = await page[0]()
     |          ^
  30 |     modType = 'page'
  31 |     filePath = page[1]
  32 |   } else if (isDefaultPage) { {
  page: '/'
}
   8 | var hasOwnProperty = Object.prototype.hasOwnProperty;
   9 |
> 10 | var EmotionCacheContext = /*#__PURE__*/createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
     |                                                     ^
  11 | // because this module is primarily intended for the browser and node
  12 | // but it's also required in react native and similar environments sometimes
  13 | // and we could have a special build just for that
 GET / 500 in 612ms

Is it just my setup or some particular version of packages is required and only that version can work?

cheers,
Mitch

Hello @Mitch,

We apologize for the delay; the fix is not yet released for production. It is expected to be available next week. We will notify you once it’s ready.

Best regards,

Hello @Mitch - I am glad to confirm the fix is now released.