3

I google like 1 hour for this error and still found no fix.

Anyone have any idea why this happen and how can I fix it?

Here it is the full error message:

 ERROR  Failed to compile with 1 errors  
 Module build failed (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
 RangeError: Invalid string length

Thank you!

4
  • Have you tried to delete the node_modules dir and then run npm install? Commented Feb 19, 2019 at 16:34
  • Can you show the html template you are trying to load? Commented Feb 19, 2019 at 16:34
  • github.com/vuejs/vue-loader/issues/1491 Commented Feb 20, 2019 at 9:38
  • In the end, it looks like this happens due to a component error. Commented Feb 22, 2019 at 9:52

1 Answer 1

3

Make sure you have vue-loader and vue-template-compiler in the dev dependencies in package.json file.

"devDependencies": {
    ....
    "vue": "^2.6.11",
    "vue-loader": "^15.5.1",
    "vue-template-compiler": "^2.6.11"
},
Sign up to request clarification or add additional context in comments.

1 Comment

why should they be under devDependencies rather than just dependencies?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.