vuejs / vue-jest

Jest Vue transformer
MIT License
748 stars 156 forks source link

[vue-jest] Error: Vue template compilation failed on less file using relative import #350

Open YutamaKotaro opened 3 years ago

YutamaKotaro commented 3 years ago

Hi!! I got this error in 5.0.0-alpha.10.

FileError: './styles/less-a.less' wasn't found. Tried - ./styles/less-a.less,styles/less-a.less in input on line 3, column 1:
2
3 @import './styles/less-a.less';
4 .a {

FAIL ./test.js
  ● Test suite failed to run

    [vue-jest] Error: Vue template compilation failed

      126 |
      127 | const throwError = function error(msg) {
    > 128 |   throw new Error('\n[vue-jest] Error: ' + msg + '\n')
          |         ^
      129 | }
      130 |
      131 | const stripInlineSourceMap = function(str) {

Using relative import in less file caused this issue. I created PR for this issue #349 .