Background
Vue and Vue cli versions for the project
“vue”: “^2.6.11”
“@vue/cli”: “~4.5.0”
I created a static directory in SRC directory to store JS and CSS, and then call it in code.
c.href = '../static/css/he-standard.css';
s.src = '../static/js/he-standard.js';
An error was found after running the project
Uncaught SyntaxError: Unexpected token '<'
solve
Put the static folder under public
c.href = '/static/css/he-standard.css';
s.src = '/static/js/he-standard.js';
Reference:
https://blog.csdn.net/weixin_43742708/article/details/110594790
Read More:
- Baidu editor echo JS error uncaught syntax error: invalid or unexpected token
- Solve the problem of syntax error: unexpected end of file or syntax error near unexpected token ` fi ‘error
- Unexpected syntax error: unexpected token<
- chunk-vendors.7142f8da.js:1 Uncaught SyntaxError: Unexpected token ‘<‘
- Syntax error: unexpected token in uni app project compilation
- syntax error near unexpected token `then’ problem solution
- Shell script syntax error near unexpected token ‘$’Do
- syntax error near unexpected token `else’
- Solve the problem of shell script “syntax error near unexpected token `fi’”.
- Syntax error near unexpected token `newline’script cannot be executed
- Docker machine install syntax error near unexpected token ‘newline’! DOCTYPE HTML problem resolution
- Syntax error near unexpected token ‘$’Do is reported when running bash file
- Shell script execution error: “syntax error near unexpected token”
- About writing [if] and [else] statements in JSP, Syntax error on token “else”, delete this token
- Error: syntax error – unexpected token P in JSON at position 0
- Error: unexpected syntax error: unexpected token<
- Syntax error on token “eat”, identifier expected after this token
- Syntax error on token “}“, delete this token
- “Unexpected syntax error: unexpected identifier”.
- [development experience] solution to unexpected syntax error: unexpected identifier in JSON parsing