Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum call stack size exceeded #78

Open
metrophos opened this issue Jul 28, 2016 · 7 comments
Open

Maximum call stack size exceeded #78

metrophos opened this issue Jul 28, 2016 · 7 comments

Comments

@metrophos
Copy link

metrophos commented Jul 28, 2016

I get an stack size error when i use remap-istanbul on windows.

RangeError: Maximum call stack size exceeded
at Object.fs.mkdirSync (fs.js:916:18)
at sync (..\node_modules\mkdirp\index.js:71:13)
at sync (..\node_modules\mkdirp\index.js:77:24)
at sync (..\node_modules\mkdirp\index.js:78:17)
at sync (..\node_modules\mkdirp\index.js:78:17)
...

I think remap-istanbul must parse to many files on my project.

To solve this issue I added a timeout function to give node.js the chance to clear the stack.

loadCoverage.js

        sources.forEach(function (filePath) {
            setTimeout(() => {
                collector.add(readJSON(filePath));
            });
        });
@jdonaghue jdonaghue added the bug label Aug 6, 2016
@g00fy-
Copy link

g00fy- commented Sep 5, 2016

same issue. The setTimeout trick worked.

@vidartf
Copy link

vidartf commented Sep 26, 2016

+1 on issue, workaround not tried.

@metrophos
Copy link
Author

Unfortunately my workaround runs not all the time correct because now you have async setTimeout on an sync call. So the timeout calls are not completed before the object is returned.

I think the solution ist to change the logic from sync calls to async, return a promise and resolve them.

@avocadee
Copy link

avocadee commented Dec 15, 2016

Try only for test purpose
node --stack_size=8192 node_modules/gulp/bin/gulp.js
but this command depends on version of your nodejs

@dylans dylans added this to the 0.9.0 milestone Jan 11, 2017
@dylans dylans modified the milestones: 0.9.0, 0.10.0 Feb 22, 2017
@Anthony-Mckale
Copy link

Two pence:

For me I was having the same issue with infinite loops

but it was caused by nested folders with windows drives in it C:\

which seemed to be causing this bug -> https://github.com/substack/node-mkdirp/issues/66

e.g. for example path creation : "C:\development\GW-Maintenance\frontend-projects\web-platform\C:\development\GW-Maintenance\frontend-projects\web-platform\src\components\products\performance\ft-calendar-year-returns\lib\en-us-retail"

from node_modules\istanbul\lib\util\file-writer.js

@dylans dylans removed this from the 0.10.0 milestone Jan 11, 2018
@jadrake75
Copy link

jadrake75 commented Oct 3, 2018

Looks like one solution might be to just go with a different library make-dir. Has anyone tried this?

@shaoxp
Copy link

shaoxp commented Nov 15, 2019

i check the info that Anthony-Mckale provides. it seems if the driver of path does not exits, it will throw this error.

my case is that my container only have C:\ while I am trying to sync with D:. after change config to use C:\ as the driver of path, the problem fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants