Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

[example] [cli] Can't build statically rendered apps when using Next.js App router #4524

Closed

Description

@bharatkashyap

Steps to reproduce

Steps:

  1. Open this link to live example: https://codesandbox.io/p/devbox/distracted-breeze-8rcrvw?file=%2Fpackage.json
  2. Run the build step

Current behavior

Fails with:

⨯ useSearchParams() should be wrapped in a suspense boundary at page "/404". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout
    at a (/Users/bharatkashyap/MUI/toolpad-core-examples/tutorial/.next/server/chunks/951.js:109:18177)
    at d (/Users/bharatkashyap/MUI/toolpad-core-examples/tutorial/.next/server/chunks/951.js:109:31273)
    at rz (/Users/bharatkashyap/MUI/toolpad-core-examples/tutorial/.next/server/chunks/951.js:109:11151)
    at n$ (/Users/bharatkashyap/MUI/toolpad-core-examples/tutorial/node_modules/.pnpm/next@15.0.4_@babel+core@7.26.0_react-dom@19.0.0_react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:45906)
    at nI (/Users/bharatkashyap/MUI/toolpad-core-examples/tutorial/node_modules/.pnpm/next@15.0.4_@babel+core@7.26.0_react-dom@19.0.0_react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:47681)
    at nL (/Users/bharatkashyap/MUI/toolpad-core-examples/tutorial/node_modules/.pnpm/next@15.0.4_@babel+core@7.26.0_react-dom@19.0.0_react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:65480)
    at nN (/Users/bharatkashyap/MUI/toolpad-core-examples/tutorial/node_modules/.pnpm/next@15.0.4_@babel+core@7.26.0_react-dom@19.0.0_react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:63111)
    at nO (/Users/bharatkashyap/MUI/toolpad-core-examples/tutorial/node_modules/.pnpm/next@15.0.4_@babel+core@7.26.0_react-dom@19.0.0_react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:46258)
    at nI (/Users/bharatkashyap/MUI/toolpad-core-examples/tutorial/node_modules/.pnpm/next@15.0.4_@babel+core@7.26.0_react-dom@19.0.0_react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:47727)
    at nI (/Users/bharatkashyap/MUI/toolpad-core-examples/tutorial/node_modules/.pnpm/next@15.0.4_@babel+core@7.26.0_react-dom@19.0.0_react@19.0.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:62462)
Error occurred prerendering page "/_not-found". Read more: https://nextjs.org/docs/messages/prerender-error

Expected behavior

Bulds successfully

Context

  • Running the example app
  • The same issue occurs when building an app created through create-toolpad-app without authentication

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Originally reported here

Hi, I've started an app with toolpad-core but I can't build it. In fact, I check that with the demo project that comes when starting an app with create toolpad-app@latest, I can't do the build either. But, I have been able to check that if I choose the project in base pages instead of app mode, I can make the build.

Search keywords: build, Next.js, Next.js app router

Activity

  1. changed the title [-][example] [cli] Can't build apps without authentication when using Next.js App router[/-] [+][example] [cli] Can't build statically rendered apps when using Next.js App router[/+] on Dec 9, 2024
  2. moved this from Backlog to Planned in Toolpad public roadmapon Dec 9, 2024
  3. moved this from Planned to In progress in Toolpad public roadmapon Dec 11, 2024
  4. moved this from In progress to Completed in Toolpad public roadmapon Dec 11, 2024
  5. github-actions commented on Dec 11, 2024

    @github-actions

    This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
    Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    examplesRelating to /examples.priority: importantThis change can make a difference.type: regressionA bug, but worse, it used to behave as expected.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions