2017-12-21 3 views
0

heroku에 배포 된 Rails 5.1.4 앱이 있습니다. vuejs와 함께 webpacker를 사용하고 있으며 이제 heroku에 배포하는 데 문제가 있습니다. 사전 컴파일 : Heroku가이 레이크 자산 실행할 때 나는 다음과 같은 MSG를 얻고 코드는 로컬에서 잘 실행레일 자산에 오류가 발생했습니다. webpacker 및 heroku가있는 파이프 라인

remote:  [13] ./app/javascript/production-guarantee-component.vue 193 bytes {0} [built] [failed] [1 error] 
remote:  [14] ./app/javascript/packs/tmp_dashboard.js 2.44 kB {1} [built] 
remote:  + 4 hidden modules 
remote:  ERROR in ./app/javascript/adder-dashboard.vue 
remote:  Module parse failed: Unexpected token (1:0) 
remote:  You may need an appropriate loader to handle this file type. 
remote:  | <template> 
remote:  | <div class="col-md-12"> 
remote:  |  <adder-component v-for="category in categories" :category ="category"></adder-component> 
remote:  @ ./app/javascript/packs/pricing_dashboard.js 16:0-52 
remote:  ERROR in ./app/javascript/app.vue 
remote:  Module parse failed: Unexpected token (1: 

을하고 Module parse failed도 정말 이해가되지 않습니다. 디버깅 할 때 제일 좋은 곳은 무엇입니까? thx

답변

0

보통 node_modules.gitignore에 추가됩니다. 현지 프로덕션 환경에서 앱을 테스트 해 보시기 바랍니다. 프로덕션 환경에서 자산을 사전 컴파일하려면 RAILS_ENV=production bundle exec rake assets:precompile을 실행하십시오.

당신이 yarn와 JS 종속성을 설치하는 경우, 사전 컴파일 레일도 yarn install를 트리거해야 다음 프로덕션 서버 rails s -e production을 실행하고

은 또한 당신이 adder-dashboard.vue에서 GitHub의 저장소를 찾아 읽을 필요 localenvironment에서 테스트 레일

https://ksylvest.com/posts/2016-09-07/augmenting-a-ruby-on-rails-app-with-vue-js

https://rlafranchi.github.io/2016/03/09/vuejs-and-rails/

로 vue.js를 사용하는 방법에 대한 문서

Use Dropzone.js with Vue.js

https://coligo.io/real-time-analytics-with-nodejs-socketio-vuejs/

관련 문제