Closed JayBox325 closed 1 year ago
can u provide a repro along with more logs so we can check what's the issue?
Here's a codesandbox: https://codesandbox.io/p/sandbox/optimistic-morning-7hp694
But it doesn't happen here, it happens when I deploy to Vercel. Full error log:
[23:45:38.370] Running build in Washington, D.C., USA (East) – iad1
[23:45:38.439] Cloning github.com/JayBox325/<project> (Branch: main, Commit: 34342d0)
[23:45:38.892] Cloning completed: 453.48ms
[23:45:51.204] Restored build cache
[23:45:51.236] Running "vercel build"
[23:45:51.755] Vercel CLI 31.0.4
[23:45:52.061] Installing dependencies...
[23:45:54.410]
[23:45:54.411] up to date in 2s
[23:45:54.411]
[23:45:54.411] 217 packages are looking for funding
[23:45:54.411] run `npm fund` for details
[23:45:54.422] Detected Next.js version: 13.4.12
[23:45:54.427] Detected `package-lock.json` generated by npm 7+...
[23:45:54.428] Running "npm run build"
[23:45:54.731]
[23:45:54.731] > <project>@0.1.0 build
[23:45:54.732] > next build
[23:45:54.732]
[23:45:55.316] - info Creating an optimized production build...
[23:46:25.258] - info Compiled successfully
[23:46:25.259] - info Linting and checking validity of types...
[23:46:28.153]
< -- removed some lint warnings that are persistent when it works & when it doesn't -- >
[23:46:28.158] info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
[23:46:28.159] - info Collecting page data...
[23:46:29.905] - info Generating static pages (0/29)
[23:46:29.972] - info Generating static pages (7/29)
[23:46:30.109] - warn Entire page /404 deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /404
[23:46:30.140] - info Generating static pages (14/29)
[23:46:30.212] - warn Entire page /free deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /free
[23:46:30.470] - warn
[23:46:31.161] - warn Entire page /offline deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /offline
[23:46:31.183] Error: NEXT_DYNAMIC_NO_SSR_CODE
[23:46:31.183] at suspense (/vercel/path0/next/.next/server/chunks/3023.js:8781:19)
[23:46:31.183] at bailoutToClientRendering (/vercel/path0/next/.next/server/chunks/3023.js:3154:36)
[23:46:31.184] at Object.useSearchParams (/vercel/path0/next/.next/server/chunks/3023.js:3970:13)
[23:46:31.184] at /vercel/path0/next/.next/server/chunks/3023.js:2382:35
[23:46:31.184] at Ue (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:113:273)
[23:46:31.184] at Ue (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:117:498)
[23:46:31.185] at Z (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)
[23:46:31.185] at Ve (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:123:155)
[23:46:31.185] at Xe (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:122:289)
[23:46:31.185] at Z (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:350) {
[23:46:31.186] digest: 'NEXT_DYNAMIC_NO_SSR_CODE'
[23:46:31.186] }
[23:46:31.240] Error: NEXT_DYNAMIC_NO_SSR_CODE
[23:46:31.241] at suspense (/vercel/path0/next/.next/server/chunks/3023.js:8781:19)
[23:46:31.241] at bailoutToClientRendering (/vercel/path0/next/.next/server/chunks/3023.js:3154:36)
[23:46:31.241] at Object.useSearchParams (/vercel/path0/next/.next/server/chunks/3023.js:3970:13)
[23:46:31.241] at /vercel/path0/next/.next/server/chunks/3023.js:2382:35
[23:46:31.242] at Ue (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:113:273)
[23:46:31.242] at Ue (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:117:498)
[23:46:31.242] at Z (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)
[23:46:31.242] at Ve (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:123:155)
[23:46:31.250] at Xe (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:122:289)
[23:46:31.250] at Z (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:350) {
[23:46:31.250] digest: 'NEXT_DYNAMIC_NO_SSR_CODE'
[23:46:31.250] }
[23:46:31.251] - warn Entire page / deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /
[23:46:31.251] - info Generating static pages (21/29)
[23:46:31.268] - warn Entire page /submit deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /submit
[23:46:31.309] - warn
[23:46:31.309] metadata.metadataBase is not set for resolving social open graph or twitter images, using "https://<project>.vercel.app". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
[23:46:31.380] - warn
[23:46:31.380] metadata.metadataBase is not set for resolving social open graph or twitter images, using "https://<project>.vercel.app". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
[23:46:31.533] - warn Entire page /tags deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /tags
[23:46:31.698] - warn Entire page /tools deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /tools
[23:46:31.833] - warn Entire page /typography deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /typography
[23:46:31.881] Error: NEXT_DYNAMIC_NO_SSR_CODE
[23:46:31.881] at suspense (/vercel/path0/next/.next/server/chunks/3023.js:8781:19)
[23:46:31.881] at bailoutToClientRendering (/vercel/path0/next/.next/server/chunks/3023.js:3154:36)
[23:46:31.881] at Object.useSearchParams (/vercel/path0/next/.next/server/chunks/3023.js:3970:13)
[23:46:31.882] at /vercel/path0/next/.next/server/chunks/3023.js:2382:35
[23:46:31.882] at Ue (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:113:273)
[23:46:31.882] at Ue (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:117:498)
[23:46:31.882] at Z (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)
[23:46:31.882] at Ve (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:123:155)
[23:46:31.882] at Xe (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:122:289)
[23:46:31.882] at Z (/vercel/path0/next/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:350) {
[23:46:31.882] digest: 'NEXT_DYNAMIC_NO_SSR_CODE'
[23:46:31.882] }
[23:46:31.904] - warn Entire page /platforms deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /platforms
[23:46:32.198] - info Generating static pages (29/29)
[23:46:32.229] - info Finalizing page optimization...
[23:46:32.233]
[23:46:32.252] Route (app) Size First Load JS
[23:46:32.252] ┌ ○ / 131 kB 301 kB
[23:46:32.252] ├ ○ /_not-found 0 B 0 B
[23:46:32.252] ├ λ /[...slug] 261 B 185 kB
[23:46:32.253] ├ ○ /apple-icon.png 0 B 0 B
[23:46:32.253] ├ ○ /favicon.ico 0 B 0 B
[23:46:32.253] ├ ○ /free 208 B 182 kB
[23:46:32.253] ├ ○ /icon.png 0 B 0 B
[23:46:32.253] ├ λ /insights/[slug] 1.65 kB 175 kB
[23:46:32.253] ├ ○ /jobs 428 B 92.4 kB
[23:46:32.253] ├ λ /jobs/[slug] 428 B 92.4 kB
[23:46:32.253] ├ ○ /offline 1.71 kB 83.5 kB
[23:46:32.253] ├ ○ /platforms 232 B 182 kB
[23:46:32.253] ├ λ /platforms/[slug] 461 B 182 kB
[23:46:32.254] ├ ○ /search 450 B 171 kB
[23:46:32.254] ├ ○ /sitemap.xml 0 B 0 B
[23:46:32.254] ├ ○ /submit 3.96 kB 175 kB
[23:46:32.254] ├ ○ /tags 217 B 171 kB
[23:46:32.254] ├ λ /tags/[slug] 450 B 171 kB
[23:46:32.254] ├ ○ /tools 3.25 kB 185 kB
[23:46:32.254] ├ λ /tools/[slug] 3.84 kB 174 kB
[23:46:32.254] ├ ○ /typography 140 B 81.3 kB
[23:46:32.254] ├ ○ /users 428 B 92.4 kB
[23:46:32.254] └ λ /users/[username] 427 B 92.4 kB
[23:46:32.254] + First Load JS shared by all 81.1 kB
[23:46:32.254] ├ chunks/596-635d35a4343308f3.js 28.6 kB
[23:46:32.254] ├ chunks/fd9d1056-7d4878b210284f07.js 50.5 kB
[23:46:32.254] ├ chunks/main-app-884f9009ba395edd.js 215 B
[23:46:32.254] └ chunks/webpack-09bfa98aeae8ad2b.js 1.85 kB
[23:46:32.254]
[23:46:32.254] Route (pages) Size First Load JS
[23:46:32.254] ─ ○ /404 182 B 76.2 kB
[23:46:32.254] + First Load JS shared by all 76 kB
[23:46:32.254] ├ chunks/framework-8883d1e9be70c3da.js 45 kB
[23:46:32.254] ├ chunks/main-4cb66da2e3d175cc.js 28.9 kB
[23:46:32.255] ├ chunks/pages/_app-52924524f99094ab.js 195 B
[23:46:32.255] └ chunks/webpack-09bfa98aeae8ad2b.js 1.85 kB
[23:46:32.255]
[23:46:32.255] λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
[23:46:32.255] ○ (Static) automatically rendered as static HTML (uses no initial props)
[23:46:32.255]
[23:46:32.255] Next.js Speed Insights is enabled for this production build. You'll receive a Real Experience Score computed by all of your visitors.
[23:46:32.255]
[23:46:35.937] Traced Next.js server files in: 3.461s
[23:46:50.775] Created all serverless functions in: 14.836s
[23:46:50.794] Collected static files (public/, static/, .next/static): 8.891ms
[23:46:51.898] Error: ENOENT: no such file or directory, open '/vercel/path0/next/.next/server/app/jobs.html'
So the build fails on Vercel, but when I comment out the <AppProgressBar />
and push to vercel, it successfully builds. Just having a Next 13.4 App Router project and adding this package causes the error.
I can provide a repo and vercel deployments if that's easier, but I'll need to find time to do that this week.
You are using next-nprogress-bar
and not this package (nextjs-progressbar
)
Apologies. The docs for this package only illustrate being used within the pages directory, does this work with the app router? I'll swap over if so!
no, check #86
When I pushed a Next 13 site up to Vercel that had this package I received the following build errors:
NEXT_DYNAMIC_NO_SSR_CODE DYNAMIC_SERVER_USAGE
When I removed this package, it resolved itself. I am unfamiliar with what/why could cause these errors so hoping someone with a bigger brain than I can advise.