Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

loader error #49

Open
okaxuan opened this issue May 29, 2018 · 6 comments
Open

loader error #49

okaxuan opened this issue May 29, 2018 · 6 comments

Comments

@okaxuan
Copy link

okaxuan commented May 29, 2018

I set up the project according to the above steps,npm run build时报错,I change the ts-loader ,the erros still have ,but different
errors:
ERROR in ./src/components/Hello.vue?vue&type=script&lang=ts
Module parse failed: Unexpected token (28:26)
You may need an appropriate loader to handle this file type.
| },
| computed: {
| exclamationMarks(): string {
| return Array(this.enthusiasm + 1).join('!');
| }
@ ./src/components/Hello.vue 2:0-56 3:0-51 3:0-51 10:2-8
@ ./src/index.ts

ERROR in ./src/components/Hello.vue?vue&type=template&id=5de655f2
Module parse failed: Unexpected token (2:0)
You may need an appropriate loader to handle this file type.
|
|


|
Hello {{name}}{{exclamationMarks}}

| <button @click="decrement">-
@ ./src/components/Hello.vue 1:0-83 11:2-8 12:2-17
@ ./src/index.ts

ERROR in ./src/components/Hello.vue?vue&type=style&index=0&lang=css
Module parse failed: Unexpected token (36:0)
You may need an appropriate loader to handle this file type.
|
|
| .greeting {
| font-size: 20px;
| }
@ ./src/components/Hello.vue 4:0-64
@ ./src/index.ts

ERROR in ./src/components/Hello.vue
vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.
@ ./src/index.ts 2:0-52 8:24-38

ERROR in ./src/components/Hello.vue?vue&type=template&id=5de655f2
vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.
@ ./src/components/Hello.vue 1:0-83 11:2-8 12:2-17
@ ./src/index.ts

ERROR in ./src/components/Hello.vue?vue&type=script&lang=ts
vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.
@ ./src/components/Hello.vue 2:0-56 3:0-51 3:0-51 10:2-8
@ ./src/index.ts

ERROR in ./src/components/Hello.vue?vue&type=style&index=0&lang=css
vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.
@ ./src/components/Hello.vue 4:0-64
@ ./src/index.ts

@okaxuan
Copy link
Author

okaxuan commented Jun 1, 2018

Reverting vue-loader to ^14.2.2 fixes the issue

@BoleLee
Copy link

BoleLee commented Jun 4, 2018

@okaxuan so it's the vue-loader version problem? I ran into the same error according to the README guide.

@BoleLee
Copy link

BoleLee commented Jun 4, 2018

vue-loader version has been updated. Accordding to PR #47 could solve the problem.

@thomthom
Copy link

thomthom commented Jun 5, 2018

@BoleLee - thank you for the heads up. That resolved the problem for me, using https://github.com/runxc1/TypeScript-Vue-Starter/blob/392263c54dfab629c69722a3e808fb5267851076/README.md instead of https://github.com/Microsoft/TypeScript-Vue-Starter#adding-webpack

@stone-lyl
Copy link

stone-lyl commented Jul 12, 2018

ERROR in ./src/components/Hello.vue
Module Error (from ./node_modules/vue-loader/lib/index.js):
vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.
@ ./src/index.ts 2:0-52 10:24-38

i also met this problem, i solved this problem like this:
// webpack.config.js

const VueLoaderPlugin = require('vue-loader/lib/plugin'); module.exports = { // ... plugins: [ new VueLoaderPlugin() ] }

vue-loader

@hhcha
Copy link

hhcha commented Nov 26, 2018

@thomthom @stone-lyl thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants