Next.js Discord

Discord Forum

Build error occurred

Unanswered
Thai posted this in #help-forum
Open in Discord
ThaiOP
Im running npm run build but im getting this error. Its been a few months since i worked on this project and as much as i remember, i never got into this issue before; the older builds are still running on vercel.

Build error occurred
RangeError: Maximum call stack size exceeded
    at isRelatedTo (H:\Coding\Nextjs\verse\node_modules\typescript\lib\typescript.js:62574:27)
    at eachTypeRelatedToType (H:\Coding\Nextjs\verse\node_modules\typescript\lib\typescript.js:63012:30)
    at unionOrIntersectionRelatedTo (H:\Coding\Nextjs\verse\node_modules\typescript\lib\typescript.js:62849:176)
    at structuredTypeRelatedToWorker (H:\Coding\Nextjs\verse\node_modules\typescript\lib\typescript.js:63431:25)
    at structuredTypeRelatedTo (H:\Coding\Nextjs\verse\node_modules\typescript\lib\typescript.js:63273:23)
    at recursiveTypeRelatedTo (H:\Coding\Nextjs\verse\node_modules\typescript\lib\typescript.js:63226:21)
    at isRelatedTo (H:\Coding\Nextjs\verse\node_modules\typescript\lib\typescript.js:62671:124)
    at isPropertySymbolTypeRelated (H:\Coding\Nextjs\verse\node_modules\typescript\lib\typescript.js:64011:16)
    at propertyRelatedTo (H:\Coding\Nextjs\verse\node_modules\typescript\lib\typescript.js:64066:25)
    at propertiesRelatedTo (H:\Coding\Nextjs\verse\node_modules\typescript\lib\typescript.js:64283:31) {
  type: 'RangeError'
}

25 Replies

ThaiOP
Here is my package.json

{
  ...
  "cookies": "^0.8.0",
  "eslint": "8.48.0",
  "eslint-config-next": "13.4.19",
  "howler": "^2.2.3",
  "next": "13.4.19",
  "next-auth": "^4.24.5",
  "postcss": "8.4.28",
  ...
}
@Arinji you need to go to 13.5.7
ThaiOP
its still not helping, I tried it on v13.5.7-canary.16 and 13.4.7, do i update/downgrade other dependencies as well?
Or just update to latest
Also delete node modules and next folder after updating
@Arinji Also delete node modules and next folder after updating
ThaiOP
Aaahh man, ive tried everything, nothing seems to be working. Ive installed the latest versions of my other packages too but still no luck!
ThaiOP
@Arinji IT WORKED!
oh god it took so long!!!! it was more of a problem with my prisma rather than the next
@Thai <@890486507872342027> IT WORKED! oh god it took so long!!!! it was more of a problem with my prisma rather than the next
Alright awesome, explain a bit more about the issue, and what you did to fix it, and mark that as the answer for future readers
American Crocodile
Same issue here
When running yarn build:
Linting and checking validity of types ...Maximum call stack size exceeded
@Thai i'm using prisma too. What was the problem?
ThaiOP
Hey there!
For me it was about the versions, im not completely sure tho
so
when i ran npx prisma generate the client were getting generated in @prisma/client@5.9.0 (latest) and but my prisma dependencies were prisma 5.6.0
i just changed package.json from

"@prisma/client": "^5.6.0"

to
"@prisma/client": "5.6.0"
so it doesnt update
here is my final package.json

{
  "name": "verse",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@next-auth/prisma-adapter": "^1.0.7",
    "@prisma/client": "5.6.0",
    "@types/node": "20.5.7",
    "@types/react": "18.2.21",
    "@types/react-dom": "18.2.7",
    "@uploadthing/react": "5.5.0",
    "autoprefixer": "10.4.15",
    "axios": "^1.5.0",
    "cookies": "^0.8.0",
    "eslint": "8.48.0",
    "eslint-config-next": "13.4.19",
    "howler": "^2.2.3",
    "next": "13.4.19",
    "next-auth": "4.24.5",
    "postcss": "8.4.28",
    "quill-blot-formatter": "^1.0.5",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-dropzone": "^14.2.3",
    "react-icons": "^4.10.1",
    "react-quill": "^2.0.0",
    "tailwindcss": "3.3.3",
    "typescript": "5.2.2",
    "uploadthing": "^5.5.2",
    "vercel": "^32.5.5",
    "zod": "^3.22.2"
  },
  "devDependencies": {
    "@types/howler": "^2.2.9",
    "prisma": "5.6.0"
  }
}
also if you were using next-auth @auth/prisma-adapter you will need to change it to @next-auth/prisma-adapter
i hope this is helpful :)
American Crocodile
NICE!
It worked for me
Thank you
ThaiOP
WOOOOOOO LETS GO!