0

I want to use vue.js with symfony 4. But I have an error when i launch this command :

yarn encore dev-server --hot

Error :

 ERROR  Failed to compile with 3 errors                                                                                                                                                       20:16:47


 error  in ./assets/js/components/Hello.vue?vue&type=template&id=e8bb2c58

Module parse failed: Unexpected token (2:0)
You may need an appropriate loader to handle this file type.
|
| <div class="hello">
|   <h1>{{ msg }}</h1>
| </div>

 @ ./assets/js/components/Hello.vue 1:0-83 30:4-35:6 30:67-35:5
 @ ./assets/js/App.vue?vue&type=script&lang=js
 @ ./assets/js/App.vue
 @ ./assets/js/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./assets/js/main.js

 error  in ./assets/js/App.vue?vue&type=template&id=12494949

Module parse failed: Unexpected token (2:0)
You may need an appropriate loader to handle this file type.
|
| <div id="app">
|   <hello></hello>
| </div>

 @ ./assets/js/App.vue 1:0-81 30:4-35:6 30:65-35:5
 @ ./assets/js/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./assets/js/main.js

 error  in ./assets/js/App.vue

vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.

 @ ./assets/js/main.js 2:0-24
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./assets/js/main.js

I don't understand why this doesn't work. I use WAMP as server. Thanks

1
  • You should show your webpack config and package.json Commented Jun 19, 2018 at 4:33

1 Answer 1

2
npm install vue-loader vue-template-compiler

OR

yarn add vue-loader vue-template-compiler
Sign up to request clarification or add additional context in comments.

1 Comment

o/ Mark answered

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.