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

[8.0.0] (node:27451) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded #681

Closed
marvindanig opened this issue May 13, 2019 · 5 comments

Comments

@marvindanig
Copy link

marvindanig commented May 13, 2019

  • Operating System: MacOS, 10.14.4
  • Node.js version: 10.6.0
  • fs-extra version: 8.0.0

I'm failing at a relatively innocuous looking line:

await fse.copy(path.join(__dirname, '..', 'book', 'templates'), path.join('.', title, 'templates')).catch(err => console.log(err))

The process simply hangs on the line above and I have to CTRL+C to exit the process. All paths resolve correctly, I double checked.

When I rewrite the line using copySync syntax, I get the following error:

fse.copySync(path.join(__dirname, '..', 'book', 'templates'), path.join('.', title, 'templates')).catch(err => { console.log(err);  process.exit(0) })

Error log:

(node:27636) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
    at getPathFromURL (internal/url.js:1395:24)
    at Object.statSync (fs.js:819:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:143:21)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/sa/Projects/ror/bubblin.io/tools/abelone/node_modules/fs-extra/lib/util/stat.js:154:10)
(node:27636) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:27636) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

But when I write with Promise.then() syntax it works:

fse.copy(path.join(__dirname, '..', 'book', 'templates'), path.join('.', title, 'templates')).catch(err => { console.log(err);  process.exit(0) })

The control moves to next line correctly when using then().catch() syntax… but my entire script is using async await pattern. One thing to note with all three syntax options is that the copying of directory is successful in each, it is only the stack execution that either hangs or exits with an error in the case of first two options.

Is this something others are seeing too?

@RyanZim
Copy link
Collaborator

RyanZim commented May 13, 2019

I believe this is the same as #678; @manidlou?

@DavidBabel
Copy link

DavidBabel commented May 13, 2019

Same here with stats, until v8 :

RangeError: Maximum call stack size exceeded
    at Object.statSync (fs.js:865:18)
    at checkParentPathsSync (/Users/david/dev/formats/node_modules/fs-extra/lib/util/stat.js:143:21)
    at checkParentPathsSync (/Users/david/dev/formats/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/david/dev/formats/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/david/dev/formats/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/david/dev/formats/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/david/dev/formats/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/david/dev/formats/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/david/dev/formats/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/david/dev/formats/node_modules/fs-extra/lib/util/stat.js:154:10)

@yvele
Copy link

yvele commented May 13, 2019

Same problem

RangeError: Maximum call stack size exceeded
    at Number (<anonymous>)
    at dateFromNumeric (internal/fs/utils.js:232:19)
    at new Stats (internal/fs/utils.js:266:16)
    at getStatsFromBinding (internal/fs/utils.js:312:10)
    at Object.statSync (fs.js:851:10)
    at checkParentPathsSync (/Users/me/project/node_modules/fs-extra/lib/util/stat.js:143:21)
    at checkParentPathsSync (/Users/me/project/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/me/project/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/me/project/node_modules/fs-extra/lib/util/stat.js:154:10)
    at checkParentPathsSync (/Users/me/project/node_modules/fs-extra/lib/util/stat.js:154:10)

Any workaround?

@manidlou
Copy link
Collaborator

manidlou commented May 13, 2019

yeah I would say this is the same as #678 and will be fixed with #679. If #679 doesn't fix it, we will dive deeper into that! but seems like that's why this issue has been happening!

@RyanZim
Copy link
Collaborator

RyanZim commented May 13, 2019

Should be fixed in v8.0.1

@RyanZim RyanZim closed this as completed May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants