JaeYeopHan / tip-archive

📦 Archiving various development tips. If you watch this repository, you can get issues related to the newly registered development tip from the GitHub feed.
https://www.facebook.com/Jbee.dev/
245 stars 8 forks source link

vue-router issue #40

Open JaeYeopHan opened 5 years ago

JaeYeopHan commented 5 years ago

Description

/foo/bar와 같이 second level path로 directly 접근을 시도할 때, 다음과 같은 에러가 발생했다.

Uncaught SyntaxError: Unexpected token <

vue-router 이슈인줄 알았는데, 디버깅 결과 정말 아무 이상이 없었다. 이유는 app.js path가 잘못되어있었다.

vue.config.js에서 publicPath값을 설정해줄 때, '' 값으로 설정해뒀더니

<script src="app.js"></script>

이런 식으로 호출하고 있었다.

Solve

vue.config.js에서 publicPath를 수정한다.

publicPath

Reference