graceful-fs crashes with "RangeError: Maximum call stack size exceeded"
See original GitHub issue❗️ NOTE FROM MAINTAINERS ❗️
This issue is result of relying on non-latest (buggy) graceful-fs
version, either directly or through other (not serverless
) dependencies. serverless
on its own expects latest version of graceful-fs
to be installed.
Crash happens when two versions of graceful-fs
are initialized and one of them is non-latest (buggy) version.
SOLUTION
Ensure project and its dependencies work only with latest graceful-fs
version.
It usually can be solved by nuking node_modules
and package-lock.json
(or yarn.lock
) and reinstalling the project.
When relying on Yarn package manager it can also be solved by adding following instruction to package.json
"resolutions": {
"graceful-fs": "4.2.2"
}
and running yarn install
(thanks @sheerun for this tip)
This is a Bug Report
Description
- What went wrong?
RangeError: Maximum call stack size exceeded
while deploying - What did you expect should have happened? Deploy without problem
- What stacktrace or error message from your provider did you see?
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:199:24)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
at WriteStream (/opt/atlassian/pipelines/agent/build/node_modules/graceful-fs/graceful-fs.js:201:29)
Similar or dependent issues:
- #6653 is probably the origin of the problem
Additional Data
- Serverless Framework Version you’re using: 1.52.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:66
- Comments:37 (13 by maintainers)
Top Results From Across the Web
Random crashes with "Maximum call stack size exceeded"
Go to the node-red folder and try the command npm ls graceful-fs This should show you a dependency tree. When you find out...
Read more >Why is my Kotlin/JS program failing with "RangeError
I've written a Kotlin/JS program that is crashing on some JavaScript engines. It's crashing on GraalVM like this: RangeError: Maximum call stack ......
Read more >Node-Red Crashed [Error] [Function:Status] Rangeerror
When looping with function nodes if the input is large 600+ size array function node will throw RangeError: Maximum call stack size exceeded...
Read more >Sls deploy - RangeError: Maximum call stack size exceeded
Deploying with latest release (1.52) - today's error is: RangeError: Maximum call stack size exceeded at Function.[Symbol.
Read more >How to fix: "RangeError: Maximum call stack size exceeded"
This can lead to the program crashing or behaving in unexpected ways. It is important to avoid creating infinite loops or deeply nested ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same problem here.
graceful-fs
not being graceful.~ Hat tip to ya good sir on pointing us in the right direction.
We ran into this issue on a pipeline build and got us head scratching for a bit. If doing this via ADO or Gitlab, ensure that you change the global serverless install during the build.
install -g serverless@1.51.0