Skip to content

Failed call to function registry #3112

Closed
@pierre-arlaud

Description

@pierre-arlaud

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions