Open JaeYeopHan opened 5 years ago
/foo/bar와 같이 second level path로 directly 접근을 시도할 때, 다음과 같은 에러가 발생했다.
/foo/bar
Uncaught SyntaxError: Unexpected token <
vue-router 이슈인줄 알았는데, 디버깅 결과 정말 아무 이상이 없었다. 이유는 app.js path가 잘못되어있었다.
app.js
/app.js
vue.config.js에서 publicPath값을 설정해줄 때, '' 값으로 설정해뒀더니
vue.config.js
publicPath
''
<script src="app.js"></script>
이런 식으로 호출하고 있었다.
vue.config.js에서 publicPath를 수정한다.
index.html
baseUrl
Description
/foo/bar
와 같이 second level path로 directly 접근을 시도할 때, 다음과 같은 에러가 발생했다.vue-router 이슈인줄 알았는데, 디버깅 결과 정말 아무 이상이 없었다. 이유는
app.js
path가 잘못되어있었다.app.js
/app.js
vue.config.js
에서publicPath
값을 설정해줄 때,''
값으로 설정해뒀더니이런 식으로 호출하고 있었다.
Solve
vue.config.js
에서 publicPath를 수정한다.publicPath
index.html
에서 참조하게 되는 base url을 의미한다.baseUrl
로 사용되었다.Reference