-
Notifications
You must be signed in to change notification settings - Fork 640
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
precompile.js TypeError: name.replace is not a function #1295
precompile.js TypeError: name.replace is not a function #1295
Comments
Call `opts.name()` before testing if the result is undefined rather than passing the function pointer downstream.
Further digging: making the simple change I proposed did not work in #1296, because when the It seems to me that regardless of whether |
Hi, I am on trip today and I will try to fix this bug tomorrow. Thanks!
…On Tue, Jul 7, 2020, 19:32 Nigel Megitt ***@***.***> wrote:
Further digging: this problem is absent in release 3.2.0, and was likely
introduced by 93129bf
<93129bf>
when yargs was replaced with commander
<https://www.npmjs.com/package/commander> by @AlynxZhou
<https://github.com/AlynxZhou> and @fdintino <https://github.com/fdintino>
- mentioning you here in case you can shed any further light on this, or
fix the issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1295 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACANVR57236NGASKKWNLD63R2MBWNANCNFSM4OSTTYKA>
.
|
* Round decimal fractions more tidily, removing unnecessary trailing characters * Move comments from ends of lines, no longer allowed in Cucumber * Nicely format fontSize as well. * Use nunjucks 3.2.0, revert when mozilla/nunjucks#1295 is fixed. * Address review comment, use class parameter instead of hardcoded value
* Round decimal fractions more tidily, removing unnecessary trailing characters * Move comments from ends of lines, no longer allowed in Cucumber * Nicely format fontSize as well. * Use nunjucks 3.2.0, revert when mozilla/nunjucks#1295 is fixed. * Address review comment, use class parameter instead of hardcoded value
I'm getting a runtime error running
precompile.js
on line 114.Command line:
gives a TypeError in the function
_precompile
when it tries to call:Debugging, this is because further up the stack, in the
precompile
function, line 85, the call to_precompile
passes in as the second argumentopts.name || input
. Whilstinput
is indeed my input filename string,opts.name
is a function pointer, not a string. Replacing this text withopts.name() || input
appears to fix the problem, though I'm not familiar enough with the codebase to understand if that is the right place to make the fix.In my case
opts.name()
returnsundefined
, which means the input filename gets used instead.nunjucks release 3.2.1
node v12.7.0
Stack trace:
The text was updated successfully, but these errors were encountered: