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

mkdirp thrown "Maximum call stack size exceeded" error when use with builtin fs and memfs #297

Open
bolasblack opened this issue May 27, 2019 · 0 comments

Comments

@bolasblack
Copy link

bolasblack commented May 27, 2019

node version: v10.15.3

Reproduce:

var { Volume } = require('memfs')
var { Union } = require('unionfs')
var mkdirp = require('mkdirp')
var fs = require('fs')

var mfs = Volume.fromJSON({ '/some/path': 'content' })
// throw "file already exists" Error, as expected
mkdirp.sync('/some/path', { fs: mfs })

var ufs1 = new Union().use(mfs).use(fs)
// throw "file already exists" Error, as expected
mkdirp.sync('/some/path', { fs: ufs1 })

var ufs2 = new Union().use(fs).use(mfs)
// throw "Maximum call stack size exceeded" Error, not expected
mkdirp.sync('/some/path', { fs: ufs2 })

/**
 * Error:
{ RangeError: Maximum call stack size exceeded
    at Object.uvException (internal/errors.js:250:21)
    at handleErrorFromBinding (fs.js:112:24)
    at Object.mkdirSync (fs.js:752:3)
    at Union.syncMethod (/Users/c4605/workSpace/pryo/fs-tree/node_modules/unionfs/lib/union.js:308:35)
    at Union.this_1.(anonymous function) [as mkdirSync] (/Users/c4605/workSpace/pryo/fs-tree/node_modules/unionfs/lib/union.js:60:34)
    at sync (/Users/c4605/workSpace/pryo/fs-tree/node_modules/mkdirp/index.js:71:13)
    at sync (/Users/c4605/workSpace/pryo/fs-tree/node_modules/mkdirp/index.js:77:24)
    at sync (/Users/c4605/workSpace/pryo/fs-tree/node_modules/mkdirp/index.js:78:17)
    at sync (/Users/c4605/workSpace/pryo/fs-tree/node_modules/mkdirp/index.js:78:17)
    at sync (/Users/c4605/workSpace/pryo/fs-tree/node_modules/mkdirp/index.js:78:17)
  prev:
   { RangeError: Maximum call stack size exceeded
       at Arguments.slice (<anonymous>)
       at extend (/Users/c4605/workSpace/pryo/fs-tree/node_modules/fast-extend/index.js:11:47)
       at getMkdirOptions (/Users/c4605/workSpace/pryo/fs-tree/node_modules/memfs/lib/volume.js:248:16)
       at Volume.mkdirSync (/Users/c4605/workSpace/pryo/fs-tree/node_modules/memfs/lib/volume.js:1525:20)
       at Union.syncMethod (/Users/c4605/workSpace/pryo/fs-tree/node_modules/unionfs/lib/union.js:308:35)
       at Union.this_1.(anonymous function) [as mkdirSync] (/Users/c4605/workSpace/pryo/fs-tree/node_modules/unionfs/lib/union.js:60:34)
       at sync (/Users/c4605/workSpace/pryo/fs-tree/node_modules/mkdirp/index.js:71:13)
       at sync (/Users/c4605/workSpace/pryo/fs-tree/node_modules/mkdirp/index.js:77:24)
       at sync (/Users/c4605/workSpace/pryo/fs-tree/node_modules/mkdirp/index.js:78:17)
       at sync (/Users/c4605/workSpace/pryo/fs-tree/node_modules/mkdirp/index.js:78:17) prev: null } }
 */
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

1 participant