ejs: mem-fs-editor's usage is broken in Pull request #129; passing filename as an array

Good day,

We find error at lib/ejs.js:529:68 — property this.opts.filename could be Array and in this case we get this trace:

TypeError: this.opts.filename.replace is not a function
    at Object.Template.generateSource (/home/dench/node_modules/generator-project-stub/node_modules/yeoman-generator/node_modules/mem-fs-editor/node_modules/ejs/lib/ejs.js:529:68)
    at Object.Template.compile (/home/dench/node_modules/generator-project-stub/node_modules/yeoman-generator/node_modules/mem-fs-editor/node_modules/ejs/lib/ejs.js:444:12)
    at Object.compile (/home/dench/node_modules/generator-project-stub/node_modules/yeoman-generator/node_modules/mem-fs-editor/node_modules/ejs/lib/ejs.js:289:16)
    at handleCache (/home/dench/node_modules/generator-project-stub/node_modules/yeoman-generator/node_modules/mem-fs-editor/node_modules/ejs/lib/ejs.js:148:16)
    at Object.exports.render (/home/dench/node_modules/generator-project-stub/node_modules/yeoman-generator/node_modules/mem-fs-editor/node_modules/ejs/lib/ejs.js:316:10)
    at copy.process (/home/dench/node_modules/generator-project-stub/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy-tpl.js:14:18)
    at applyProcessingFunc (/home/dench/node_modules/generator-project-stub/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy.js:13:16)
    at EditionInterface.exports._copySingle (/home/dench/node_modules/generator-project-stub/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy.js:51:16)
    at EditionInterface.<anonymous> (/home/dench/node_modules/generator-project-stub/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy.js:38:10)
    at Array.forEach (native)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (2 by maintainers)

Commits related to this issue

Most upvoted comments

@RyanZim no worries, these things happen. And fwiw I think you’re right, calling render() with a filename array is very strange behavior that ejs probably shouldn’t be supporting.

@mde No tag needed. I was just leaving it open for the benefit of others affected by this change.

@FredKSchott Sorry about that. We were pushing a hotfix for https://github.com/mde/ejs/issues/164, so it was done in haste. We probably still wouldn’t have thought about this change though. I opened issue #168 as a possible help for this kind of thing.