vue-parser icon indicating copy to clipboard operation
vue-parser copied to clipboard

Nondescriptive error when self-closing <script /> tag is encountered

Open ascott18 opened this issue 6 years ago • 0 comments

While it is true that a self-closing <script src="./path/to/file.js" /> tag is not valid HTML, it would be nice if there could be a more descriptive error when one is encountered. Currently, the following error is thrown when a self-closing script tag is encountered:

        var nodeContent = input.substring(node.__location.startTag.endOffset, node.__location.endTag.startOffset);
                                                                                                     ^

TypeError: Cannot read property 'startOffset' of undefined
    at padContent (node_modules\vue-parser\lib\index.js:34:102)
    at Object.parse (node_modules\vue-parser\lib\index.js:19:22)
    at Object.host.getSourceFile (node_modules\fork-ts-checker-webpack-plugin\lib\VueProgram.js:110:40)
    at findSourceFile (node_modules\typescript\lib\typescript.js:79645:29)

ascott18 avatar Jun 30 '18 05:06 ascott18