2

I want to build a Next.js app but when I run yarn build --debug it shows some warning and than proceeds to hang forever. I upload it to Netlify to try it there too and these are the last logs:

8:46:22 PM: ────────────────────────────────────────────────────────────────
8:46:22 PM:   2. Build command from Netlify app                             
8:46:22 PM: ────────────────────────────────────────────────────────────────
8:46:22 PM: ​
8:46:22 PM: $ CI= yarn build
8:46:22 PM: yarn run v1.22.10
8:46:22 PM: warning package.json: No license field
8:46:22 PM: $ next build
8:46:23 PM: warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
8:46:23 PM: info  - Checking validity of types...
8:46:23 PM: warn  - No ESLint configuration detected. Run next lint to begin setup
8:46:23 PM: info  - Creating an optimized production build...
8:46:24 PM: warn  - The following reserved Next.js pages were detected not directly under the pages directory:
8:46:24 PM: /landing/pages/_app
8:46:24 PM: See more info here: https://nextjs.org/docs/messages/nested-reserved-page
8:46:24 PM: info  - Using the createRoot API for React
8:46:43 PM: (node:1779) [DEP_WEBPACK_MODULE_UPDATE_HASH] DeprecationWarning: Module.updateHash: Use new ChunkGraph API
8:46:43 PM: (Use `node --trace-deprecation ...` to show where the warning was created)
9:19:53 PM: Build exceeded maximum allowed runtime

Running dev works perfectly.

This is my GitHub repo: https://github.com/LikeWho54/link-dashboard

juliomalves
  • 42,130
  • 20
  • 150
  • 146
like who
  • 111
  • 2
  • 12
  • 1
    The `pages` folder should only contain page components and Next.js will try to build each file present in the folder as a page. You should move all the non-page components out of the `pages` folder. See [Can't build React/Next project - found page without a React Component as default export (context api file)](https://stackoverflow.com/questions/65598753/cant-build-react-next-project-found-page-without-a-react-component-as-default). – juliomalves Aug 14 '22 at 08:33
  • Hi, I've removed the files, but i get the same error, i've updated the repo – like who Aug 14 '22 at 10:32
  • I was able to pinpoint the issue coming from `content_analytics.js` file, namely the `react-rainbow-components` imports. Although I'm not sure about the underlying problem, commenting out the `react-rainbow-components` imports and the code that uses its components seems to make the build successful. – juliomalves Aug 14 '22 at 11:50

0 Answers0