0👍
An invalid src
path (i.e., ../javascripts/test.js
) is likely the problem. Your server is probably configured with an index.html
fallback, which is returned for files not found. You can confirm this in your browser’s developer tools (find test.js
in Network Panel). Since the HTML file (which probably begins with <head>
) is sourced into the <script>
, you get a JavaScript syntax error for the <
character of <head>
.
You’ll need to update the src
path to be relative to the root document and not to the directory of the component.
- [Vuejs]-Importing a JavaScript class into a Vue single file component using Laravel Mix
- [Vuejs]-Creating a link in VueJS to pass JSON value
Source:stackexchange.com