Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bharatkashyap opened this issue Dec 9, 2024 · 1 comment · Fixed by #4526
Closed
Labels
examples Relating to /examples priority: important This change can make a difference regression A bug, but worse

Comments

@bharatkashyap
Copy link
Member

bharatkashyap commented Dec 9, 2024

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/[email protected]_@[email protected][email protected][email protected]/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/[email protected]_@[email protected][email protected][email protected]/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/[email protected]_@[email protected][email protected][email protected]/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/[email protected]_@[email protected][email protected][email protected]/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/[email protected]_@[email protected][email protected][email protected]/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/[email protected]_@[email protected][email protected][email protected]/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/[email protected]_@[email protected][email protected][email protected]/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

@bharatkashyap bharatkashyap added regression A bug, but worse examples Relating to /examples priority: important This change can make a difference labels Dec 9, 2024
@bharatkashyap bharatkashyap 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 Dec 9, 2024
@prakhargupta1 prakhargupta1 moved this from Backlog to Planned in MUI Toolpad public roadmap Dec 9, 2024
@bharatkashyap bharatkashyap moved this from Planned to In progress in MUI Toolpad public roadmap Dec 11, 2024
@github-project-automation github-project-automation bot moved this from In progress to Completed in MUI Toolpad public roadmap Dec 11, 2024
Copy link

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
Labels
examples Relating to /examples priority: important This change can make a difference regression A bug, but worse
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

1 participant