Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Doesn’t work with Less 2.1.0 #4

Closed
vnys opened this issue Nov 26, 2014 · 4 comments · Fixed by less/less.js#2311
Closed

Doesn’t work with Less 2.1.0 #4

vnys opened this issue Nov 26, 2014 · 4 comments · Fixed by less/less.js#2311

Comments

@vnys
Copy link

vnys commented Nov 26, 2014

This plugin stopped working with Less 2.1.0 when using the promise syntax.

@import (less, reference) 'npm://npm-import-plugin-test/file.css';
div:extend(.test_file_css) { }
    var file = fs.readFileSync('css/styles.less', 'utf8'),
        options = { plugins: [ npmImport ] },
        log = console.log.bind(console);

    // Works with Less 2.0.0 but in 2.1.0 it returns "[TypeError: undefined is not a function]"
    less.render(file, options)
        .then(log)
        .catch(log);


    // Works with Less 2.1.0
    less.render(file, options, function(error, output) {
        log(error || output);
    });

Test repo at https://github.com/batfink/less-bug

@ForbesLindesay
Copy link

Have you tried running without this plugin? Are you sure it's caused by the plugin and not something else?

@ForbesLindesay
Copy link

Also, could you publish a stack trace, rather than just the exception

@ForbesLindesay
Copy link

Ah, I have a stack trace now:

TypeError: undefined is not a function
    at module.exports (/less-test/node_modules/less-plugin-npm-import/lib/npm-file-manager.js:12:32)
    at Object.module.exports.install (/less-test/node_modules/less-plugin-npm-import/lib/index.js:6:30)
    at PluginManager.addPlugin (/less-test/node_modules/less/lib/less/plugin-manager.js:28:12)
    at PluginManager.addPlugins (/less-test/node_modules/less/lib/less/plugin-manager.js:18:18)
    at render (/less-test/node_modules/less/lib/less/render.js:30:27)
    at /less-test/node_modules/less/lib/less/render.js:17:17
    at doResolve (/less-test/node_modules/promise/lib/core.js:91:5)
    at new Promise (/less-test/node_modules/promise/lib/core.js:71:3)
    at Object.render (/less-test/node_modules/less/lib/less/render.js:16:20)
    at Object.exports.renderAsync (/less-test/index.js:36:15)

@lukeapage
Copy link
Member

thanks @ForbesLindesay - I've release 2.1.1 which works with this plugin and bumped the requirements for this plugin to 2.1.1 to make it clear it doesn't work with 2.0

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

Successfully merging a pull request may close this issue.

3 participants