So I'm getting the following error when I try to load an external js file in the index.html
Uncaught SyntaxError: Unexpected token <
This how I'm calling it:
<script async src="/src/assets/fabric.min.js"></script>
I'm not sure why it's giving this error because if I use cdnjs it works fine:
<script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.7.22/fabric.min.js"></script>
I can provide more details if necessary.
asked Jan 9, 2018 at 23:57
A. L
12.7k29 gold badges100 silver badges179 bronze badges
1 Answer 1
Solved this by moving the required file into the static folder.
answered Jan 10, 2018 at 0:16
A. L
12.7k29 gold badges100 silver badges179 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js
https://www.npmjs.com/package/fabricthen install it usingVue.use(fabric)http://localhost:8080/#/<. But you already solved it.