microsoft / TypeScript-Vue-Starter

A starter template for TypeScript and Vue with a detailed README describing how to use the two together.
MIT License
4.45k stars 592 forks source link

loader error #49

Open okaxuan opened 6 years ago

okaxuan commented 6 years ago

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 commented 6 years ago

Reverting vue-loader to ^14.2.2 fixes the issue

BoleLee commented 6 years ago

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

BoleLee commented 6 years ago

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

thomthom commented 6 years ago
stone-lyl commented 6 years ago

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 commented 5 years ago

@thomthom @stone-lyl thanks