Skip to content

@import "styles.less" error #219

Open
@BananaAcid

Description

@BananaAcid

It seems there is a bug, when trying to import a less file

<style scoped lang="less">
//@import '/styles/test.less';   --- BREAKS, but file exists.
@import '/styles/test-css.css'; // works

@color: green;        // works
div { color: green; } // works
</style>

using;

https://cdn.jsdelivr.net/npm/[email protected]/dist/less.min.js/+esm

error:

[email protected]:26 TypeError: Cannot read properties of undefined (reading 'imports')
    at less (vue3-sfc-loader.esm.…sourcemap:90:131136)
    at vue3-sfc-loader.esm.…sourcemap:90:174100
    at ca (vue3-sfc-loader.esm.…sourcemap:90:174198)
    at t.compileStyleAsync (vue3-sfc-loader.esm.…sourcemap:90:249190)
    at vue3-sfc-loader.esm.…:sourcemap:113:6617
    at async pe (vue3-sfc-loader.esm.…:sourcemap:113:1403)
    at async vue3-sfc-loader.esm.…:sourcemap:113:6385
    at async vue3-sfc-loader.esm.…:sourcemap:113:3249
    at async me (vue3-sfc-loader.esm.…:sourcemap:113:7503)
    at async Pe (vue3-sfc-loader.esm.…:sourcemap:113:9845)

(source maps can not be loaded ... something about waiting ...)

Test here;

https://stackblitz.com/edit/bananaacid-vue3-esm-browser-only?file=example%2Fcomponents%2FPrimeTest.vue,example%2Fstyles%2Ftest.less

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingunconfirmedUnconfirmed issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions