Replies: 17 comments 10 replies
-
Alright, I'm now convinced this is coming from some part of webpack (just based on Googling and finding other issues from the past). But setting Feel free to close if this is out of scope of next.js, but I figured it might be relevant if next.js is fiddling with stack size somewhere, managing the webpack config, or has some flag I can use to make debugging this better. |
Beta Was this translation helpful? Give feedback.
-
You can use the normal debugging methods of profiling during the development run and checking the memory usage. Next.js 12 has many improvements including improved memory management so I'd recommend to start by upgrading to the latest version 👍 |
Beta Was this translation helpful? Give feedback.
-
Converted to discussions given that there is no reproduction that can be investigated so it's not actionable to investigate from our side 👍 |
Beta Was this translation helpful? Give feedback.
-
We're also experiencing this on the latest version of next.js and every build tool we use -- is it possibly related to node v16? |
Beta Was this translation helpful? Give feedback.
-
I'm seeing the same error on
Node version: v16.13.0 As others have noted, downgraded to Node v14 does indeed resolve the issue. This is really hard to reproduce on node v16, I believe it's in conjunction with other packages, like referenced in #30330. For instance, I'm using |
Beta Was this translation helpful? Give feedback.
-
Unclear if it's related but I've seen
on a big source file that was also included in |
Beta Was this translation helpful? Give feedback.
-
I'm still having issues with the latest versions, ie.: wait - compiling /_error (client and server)...
error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[2].oneOf[5].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[2].oneOf[5].use[2]!./node_modules/next/dist/build/webpack/loaders/resolve-url-loader/index.js??ruleSet[1].rules[2].oneOf[5].use[3]!./node_modules/next/dist/compiled/sass-loader/cjs.js??ruleSet[1].rules[2].oneOf[5].use[4]!./src/pages/path/myPage.module.scss
Cannot read properties of undefined (reading 'indexOf') |
Beta Was this translation helpful? Give feedback.
-
I tried switching the version of the node from 16.16.0 to 16.0.0 via NVM. Removed '.next' then 'yarn dev' again. It worked. |
Beta Was this translation helpful? Give feedback.
-
I'm having a similar problem, npm run dev is working but npm run build fails with the call stack error. Rolling back to an older version of typescript, 4.5.5, seems to have resolved it for me. I just updated it in the package.json and ran npm install. This works with both node 16.16.0 and 16.0.0. It works on typescript up to 4.5.5 (also tested 4.3.2 and 4.4.4) and fails on 4.6.4 and 4.7.4. |
Beta Was this translation helpful? Give feedback.
-
It is likely that a function with an infinite loop is being called |
Beta Was this translation helpful? Give feedback.
-
Agree with @Alireza17224, this is either a very deep (nasty) nested function or very likely a function that ends up calling itself. node --stack-size=1200 ./node_modules/next/dist/cli/next-dev.js
# or
node --stack-size=1200 ./node_modules/next/dist/cli/next-start.js This runs |
Beta Was this translation helpful? Give feedback.
-
Just trying to add to the potential debugging if I can. I was able to able to hit this issue as well. My steps were that I switched to using a custom .babelrc. When I did this, I got:
My babelrc is very basic:
I'm using Next.js 13.0.1. The failing regular expression is: I'm seeing this intermittently. I don't know if it is related to the original issue or not but wanted to add the info in case this helps. |
Beta Was this translation helpful? Give feedback.
-
In my case middleware.ts seems to be a reason. |
Beta Was this translation helpful? Give feedback.
-
A second time I faced this issue. EditMade some changes and faced this error.
Well - seems like I have to roll back to bcrypt instead, since their suggestion to use Web Crypto Api doesn't provide |
Beta Was this translation helpful? Give feedback.
-
In my case, importing Head from next/document was what started the issue, but you also can't build while importing it from next/head on next build, so I imported it from next/head in _app.js. |
Beta Was this translation helpful? Give feedback.
-
I've just stumbled upon this issue today, on What I did was: I created a function in an The fix: I removed the import from the API routes. It was interfering with the middleware in my case. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem with nextjs v15 and nodejs v20.14.0. |
Beta Was this translation helpful? Give feedback.
-
What version of Next.js are you using?
11.1.2
What version of Node.js are you using?
16.13.0
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
When running
next dev
, all requests error withMaximum call stack size exceeded
:I don't see any other logs, so I'm not entirely sure if this is a Next.js issue or some dependency. Running
rm -rf .next/ node_modules/
and re-installing doesn't work either, but restarting my laptop does.Is there some way I can get the full stack?
This has been fine for a few months now and only started happening frequently (about once a day) in the last 2 weeks.
Expected Behavior
I'd expect the page to load normally.
To Reproduce
I can't repro this unfortunately, so I'm looking for troubleshooting steps to further isolate the error.
Beta Was this translation helpful? Give feedback.
All reactions