You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding <Analytics /> causes the build to break on vercel.com
I am trying to understand this, but running the build locally (next build) works great. When I push my changes up into GitHub / Vercel, the build breaks. For every page listed under the /pages directory I get the error:
Error occurred prerendering page "/my-page". Read more: https://nextjs.org/docs/messages/prerender-error
--
15:38:49.692 | TypeError: Cannot read properties of null (reading 'useEffect')
15:38:49.692 | at exports.useEffect (/vercel/path0/node_modules/react/cjs/react.production.min.js:24:292)
15:38:49.692 | at Analytics (file:///vercel/path0/node_modules/@vercel/analytics/src/react.tsx:33:3)
15:38:49.692 | at Ge (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:114:273)
15:38:49.692 | at Z (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:91)
15:38:49.693 | at He (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:123:155)
15:38:49.693 | at Je (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:122:100)
15:38:49.693 | at Z (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:222)
15:38:49.693 | at He (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:123:155)
15:38:49.693 | at Ge (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:115:215)
15:38:49.694 | at Z (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:91)
15:38:49.696 | TypeError: Cannot read properties of null (reading 'useEffect')
15:38:49.696 | at exports.useEffect (/vercel/path0/node_modules/react/cjs/react.production.min.js:24:292)
15:38:49.697 | at Analytics (file:///vercel/path0/node_modules/@vercel/analytics/src/react.tsx:33:3)
15:38:49.697 | at Ge (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:114:273)
15:38:49.697 | at Z (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:91)
15:38:49.697 | at He (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:123:155)
15:38:49.697 | at Je (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:122:100)
15:38:49.697 | at Z (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:222)
15:38:49.697 | at He (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:123:155)
15:38:49.698 | at Ge (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:115:215)
15:38:49.698 | at Z (/vercel/path0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:91)
I have tried listing the <Analytics /> in both the _app.tsx and _document.tsx, but neither location seem to work.
Any ideas?
The text was updated successfully, but these errors were encountered:
Problem
Adding
<Analytics />
causes the build to break on vercel.comI am trying to understand this, but running the build locally (
next build
) works great. When I push my changes up into GitHub / Vercel, the build breaks. For every page listed under the/pages
directory I get the error:I have tried listing the
<Analytics />
in both the _app.tsx and _document.tsx, but neither location seem to work.Any ideas?
The text was updated successfully, but these errors were encountered: