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

Failed call to function registry #3112

Closed
pierre-arlaud opened this issue Oct 5, 2017 · 3 comments
Closed

Failed call to function registry #3112

pierre-arlaud opened this issue Oct 5, 2017 · 3 comments
Labels

Comments

@pierre-arlaud
Copy link

Consider following code:

var less = require('less');
var src = `
@file: ext();
@import '@{file}';
`;

less.functions.functionRegistry.add('ext', () => new less.tree.Anonymous('file'));
less.render(src, {}, (error, output) => {
    if (error) return console.log(error.stack);
    console.log(output);
});

Provided "file.less" exists, this code compiles in less 2.4.0 and does include "file.less".
For any newer version however, I'm getting the following:

TypeError: Cannot read property 'get' of undefined
at new functionCaller (C:\Users\pgarlaud\tmp\less\node_modules\less\lib\less\functions\function-caller.js:9:51)
at Node.Call.eval (C:\Users\pgarlaud\tmp\less\node_modules\less\lib\less\tree\call.js:32:30)
at Node.Expression.eval (C:\Users\pgarlaud\tmp\less\node_modules\less\lib\less\tree\expression.js:31:37)

@matthew-dean
Copy link
Member

Which Less version does this apply to?

@pierre-arlaud
Copy link
Author

@matthew-dean I've see it fail on 2.5.0, 2.5.1, 2.6.0, 2.6.1, 3.0.0-pre.1 and I just checked the bug is also occuring on 3.0.0-alpha.3.

As I said, I believe the 2.4.0 is the last version where the given test case works.

Thank you for your concern.

matthew-dean added a commit that referenced this issue Oct 10, 2017
@matthew-dean
Copy link
Member

Fixed. Will be in next alpha release.

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

No branches or pull requests

2 participants