Vue工程报错解决方案import Vue from "vue";

 INFO  Starting development server...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
98% after emitting CopyPlugin

 DONE  Compiled successfully in 7753ms                                  21:03:53
WARNING in D:/GitHub Project/pay/src/App.vue(8,32):
8:32 " should be ‘
     6 |
     7 | <script lang="ts">
  >  8 | import { Component, Vue } from "vue-property-decorator";
       |                                ^
     9 | import AllCourse from "./views/all_course/index.vue";
    10 |
    11 | @Component({
WARNING in D:/GitHub Project/pay/src/App.vue(9,23):
9:23 " should be ‘
     7 | <script lang="ts">
     8 | import { Component, Vue } from "vue-property-decorator";
  >  9 | import AllCourse from "./views/all_course/index.vue";
       |                       ^
    10 |
    11 | @Component({
    12 |   components: {
WARNING in D:/GitHub Project/pay/src/App.vue(13,14):
13:14 Missing trailing comma
    11 | @Component({
    12 |   components: {
  > 13 |     AllCourse
       |              ^
    14 |   }
    15 | })
    16 | export default class App extends Vue {}
WARNING in D:/GitHub Project/pay/src/App.vue(14,4):
14:4 Missing trailing comma
    12 |   components: {
    13 |     AllCourse
  > 14 |   }
       |    ^
    15 | })
    16 | export default class App extends Vue {}
    17 | </script>
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_block.vue(24,17):
24:17 " should be ‘
    22 |
    23 | <script lang="ts">
  > 24 | import Vue from "vue";
       |                 ^
    25 | import { Component, Vue } from "vue-property-decorator";
    26 |
    27 | @Component
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_block.vue(25,32):
25:32 " should be ‘
    23 | <script lang="ts">
    24 | import Vue from "vue";
  > 25 | import { Component, Vue } from "vue-property-decorator";
       |                                ^
    26 |
    27 | @Component
    28 | export default class CourseBlock extends Vue {}
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(39,17):
39:17 " should be ‘
    37 |
    38 | <script lang="ts">
  > 39 | import Vue from "vue";
       |                 ^
    40 | import { Component, Vue } from "vue-property-decorator";
    41 |
    42 | import CourseBlock from "./course_block.vue";
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(40,32):
40:32 " should be ‘
    38 | <script lang="ts">
    39 | import Vue from "vue";
  > 40 | import { Component, Vue } from "vue-property-decorator";
       |                                ^
    41 |
    42 | import CourseBlock from "./course_block.vue";
    43 |
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(42,25):
42:25 " should be ‘
    40 | import { Component, Vue } from "vue-property-decorator";
    41 |
  > 42 | import CourseBlock from "./course_block.vue";
       |                         ^
    43 |
    44 | @Component({
    45 |   components: {
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(46,16):
46:16 Missing trailing comma
    44 | @Component({
    45 |   components: {
  > 46 |     CourseBlock
       |                ^
    47 |   }
    48 | })
    49 | export default class CourseList extends Vue {
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(47,4):
47:4 Missing trailing comma
    45 |   components: {
    46 |     CourseBlock
  > 47 |   }
       |    ^
    48 | })
    49 | export default class CourseList extends Vue {
    50 |   data() {
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(50,3):
50:3 The class method ‘data‘ must be marked either ‘private‘, ‘public‘, or ‘protected‘
    48 | })
    49 | export default class CourseList extends Vue {
  > 50 |   data() {
       |   ^
    51 |     return [
    52 |       {
    53 |         bg: "dasdas",
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(53,13):
53:13 " should be ‘
    51 |     return [
    52 |       {
  > 53 |         bg: "dasdas",
       |             ^
    54 |         title: "Java语言入门",
    55 |         author: "jiaoge",
    56 |         degree: 3
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(54,16):
54:16 " should be ‘
    52 |       {
    53 |         bg: "dasdas",
  > 54 |         title: "Java语言入门",
       |                ^
    55 |         author: "jiaoge",
    56 |         degree: 3
    57 |       },
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(55,17):
55:17 " should be ‘
    53 |         bg: "dasdas",
    54 |         title: "Java语言入门",
  > 55 |         author: "jiaoge",
       |                 ^
    56 |         degree: 3
    57 |       },
    58 |       {
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(56,18):
56:18 Missing trailing comma
    54 |         title: "Java语言入门",
    55 |         author: "jiaoge",
  > 56 |         degree: 3
       |                  ^
    57 |       },
    58 |       {
    59 |         bg: "dasdas",
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(59,13):
59:13 " should be ‘
    57 |       },
    58 |       {
  > 59 |         bg: "dasdas",
       |             ^
    60 |         title: "Java语言入门",
    61 |         author: "jiaoge",
    62 |         degree: 3
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(60,16):
60:16 " should be ‘
    58 |       {
    59 |         bg: "dasdas",
  > 60 |         title: "Java语言入门",
       |                ^
    61 |         author: "jiaoge",
    62 |         degree: 3
    63 |       },
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(61,17):
61:17 " should be ‘
    59 |         bg: "dasdas",
    60 |         title: "Java语言入门",
  > 61 |         author: "jiaoge",
       |                 ^
    62 |         degree: 3
    63 |       },
    64 |       {
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(62,18):
62:18 Missing trailing comma
    60 |         title: "Java语言入门",
    61 |         author: "jiaoge",
  > 62 |         degree: 3
       |                  ^
    63 |       },
    64 |       {
    65 |         bg: "dasdas",
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(65,13):
65:13 " should be ‘
    63 |       },
    64 |       {
  > 65 |         bg: "dasdas",
       |             ^
    66 |         title: "Java语言入门",
    67 |         author: "jiaoge",
    68 |         degree: 3
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(66,16):
66:16 " should be ‘
    64 |       {
    65 |         bg: "dasdas",
  > 66 |         title: "Java语言入门",
       |                ^
    67 |         author: "jiaoge",
    68 |         degree: 3
    69 |       },
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(67,17):
67:17 " should be ‘
    65 |         bg: "dasdas",
    66 |         title: "Java语言入门",
  > 67 |         author: "jiaoge",
       |                 ^
    68 |         degree: 3
    69 |       },
    70 |       {
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(68,18):
68:18 Missing trailing comma
    66 |         title: "Java语言入门",
    67 |         author: "jiaoge",
  > 68 |         degree: 3
       |                  ^
    69 |       },
    70 |       {
    71 |         bg: "dasdas",
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(71,13):
71:13 " should be ‘
    69 |       },
    70 |       {
  > 71 |         bg: "dasdas",
       |             ^
    72 |         title: "Java语言入门",
    73 |         author: "jiaoge",
    74 |         degree: 3
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(72,16):
72:16 " should be ‘
    70 |       {
    71 |         bg: "dasdas",
  > 72 |         title: "Java语言入门",
       |                ^
    73 |         author: "jiaoge",
    74 |         degree: 3
    75 |       },
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(73,17):
73:17 " should be ‘
    71 |         bg: "dasdas",
    72 |         title: "Java语言入门",
  > 73 |         author: "jiaoge",
       |                 ^
    74 |         degree: 3
    75 |       },
    76 |       {
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(74,18):
74:18 Missing trailing comma
    72 |         title: "Java语言入门",
    73 |         author: "jiaoge",
  > 74 |         degree: 3
       |                  ^
    75 |       },
    76 |       {
    77 |         bg: "dasdas",
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(77,13):
77:13 " should be ‘
    75 |       },
    76 |       {
  > 77 |         bg: "dasdas",
       |             ^
    78 |         title: "Java语言入门",
    79 |         author: "jiaoge",
    80 |         degree: 3
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(78,16):
78:16 " should be ‘
    76 |       {
    77 |         bg: "dasdas",
  > 78 |         title: "Java语言入门",
       |                ^
    79 |         author: "jiaoge",
    80 |         degree: 3
    81 |       }
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(79,17):
79:17 " should be ‘
    77 |         bg: "dasdas",
    78 |         title: "Java语言入门",
  > 79 |         author: "jiaoge",
       |                 ^
    80 |         degree: 3
    81 |       }
    82 |     ];
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(80,18):
80:18 Missing trailing comma
    78 |         title: "Java语言入门",
    79 |         author: "jiaoge",
  > 80 |         degree: 3
       |                  ^
    81 |       }
    82 |     ];
    83 |   }
WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(81,8):
81:8 Missing trailing comma
    79 |         author: "jiaoge",
    80 |         degree: 3
  > 81 |       }
       |        ^
    82 |     ];
    83 |   }
    84 | }
WARNING in D:/GitHub Project/pay/src/views/all_course/components/header.vue(12,17):
12:17 " should be ‘
    10 |
    11 | <script lang="ts">
  > 12 | import Vue from "vue";
       |                 ^
    13 | import { Component, Vue } from "vue-property-decorator";
    14 |
    15 | @Component
WARNING in D:/GitHub Project/pay/src/views/all_course/components/header.vue(13,32):
13:32 " should be ‘
    11 | <script lang="ts">
    12 | import Vue from "vue";
  > 13 | import { Component, Vue } from "vue-property-decorator";
       |                                ^
    14 |
    15 | @Component
    16 | export default class Header extends Vue {}
WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(11,17):
11:17 " should be ‘
     9 |
    10 | <script lang="ts">
  > 11 | import Vue from "vue";
       |                 ^
    12 | import { Component, Vue } from "vue-property-decorator";
    13 |
    14 | import Header from "./components/header.vue";
WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(12,32):
12:32 " should be ‘
    10 | <script lang="ts">
    11 | import Vue from "vue";
  > 12 | import { Component, Vue } from "vue-property-decorator";
       |                                ^
    13 |
    14 | import Header from "./components/header.vue";
    15 | import CourseList from "./components/course_list.vue";
WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(14,20):
14:20 " should be ‘
    12 | import { Component, Vue } from "vue-property-decorator";
    13 |
  > 14 | import Header from "./components/header.vue";
       |                    ^
    15 | import CourseList from "./components/course_list.vue";
    16 |
    17 | @Component({
WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(15,24):
15:24 " should be ‘
    13 |
    14 | import Header from "./components/header.vue";
  > 15 | import CourseList from "./components/course_list.vue";
       |                        ^
    16 |
    17 | @Component({
    18 |   components: {
WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(20,15):
20:15 Missing trailing comma
    18 |   components: {
    19 |     Header,
  > 20 |     CourseList
       |               ^
    21 |   }
    22 | })
    23 | export default class AllCourse extends Vue {}
WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(21,4):
21:4 Missing trailing comma
    19 |     Header,
    20 |     CourseList
  > 21 |   }
       |    ^
    22 | })
    23 | export default class AllCourse extends Vue {}
    24 | </script>
WARNING in D:/GitHub Project/pay/src/views/Home.vue(10,53):
10:53 Missing semicolon
     8 | <script>
     9 | // @ is an alias to /src
  > 10 | import HelloWorld from ‘@/components/HelloWorld.vue‘
       |                                                     ^
    11 |
    12 | export default {
    13 |   name: ‘home‘,
WARNING in D:/GitHub Project/pay/src/views/Home.vue(15,15):
15:15 Missing trailing comma
    13 |   name: ‘home‘,
    14 |   components: {
  > 15 |     HelloWorld
       |               ^
    16 |   }
    17 | }
    18 | </script>
WARNING in D:/GitHub Project/pay/src/views/Home.vue(16,4):
16:4 Missing trailing comma
    14 |   components: {
    15 |     HelloWorld
  > 16 |   }
       |    ^
    17 | }
    18 | </script>
    19 |
WARNING in D:/GitHub Project/pay/src/views/Home.vue(17,2):
17:2 Missing semicolon
    15 |     HelloWorld
    16 |   }
  > 17 | }
       |  ^
    18 | </script>
    19 |
ERROR in D:/GitHub Project/pay/src/views/all_course/components/course_block.vue(24,8):
24:8 Duplicate identifier ‘Vue‘.
    22 |
    23 | <script lang="ts">
  > 24 | import Vue from "vue";
       |        ^
    25 | import { Component, Vue } from "vue-property-decorator";
    26 |
    27 | @Component
ERROR in D:/GitHub Project/pay/src/views/all_course/components/course_block.vue(25,21):
25:21 Duplicate identifier ‘Vue‘.
    23 | <script lang="ts">
    24 | import Vue from "vue";
  > 25 | import { Component, Vue } from "vue-property-decorator";
       |                     ^
    26 |
    27 | @Component
    28 | export default class CourseBlock extends Vue {}
ERROR in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(39,8):
39:8 Duplicate identifier ‘Vue‘.
    37 |
    38 | <script lang="ts">
  > 39 | import Vue from "vue";
       |        ^
    40 | import { Component, Vue } from "vue-property-decorator";
    41 |
    42 | import CourseBlock from "./course_block.vue";
ERROR in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(40,21):
40:21 Duplicate identifier ‘Vue‘.
    38 | <script lang="ts">
    39 | import Vue from "vue";
  > 40 | import { Component, Vue } from "vue-property-decorator";
       |                     ^
    41 |
    42 | import CourseBlock from "./course_block.vue";
    43 |
ERROR in D:/GitHub Project/pay/src/views/all_course/components/header.vue(12,8):12:8 Duplicate identifier ‘Vue‘.
    10 |
    11 | <script lang="ts">
  > 12 | import Vue from "vue";
       |        ^
    13 | import { Component, Vue } from "vue-property-decorator";
    14 |
    15 | @Component
ERROR in D:/GitHub Project/pay/src/views/all_course/components/header.vue(13,21):
13:21 Duplicate identifier ‘Vue‘.
    11 | <script lang="ts">
    12 | import Vue from "vue";
  > 13 | import { Component, Vue } from "vue-property-decorator";
       |                     ^
    14 |
    15 | @Component
    16 | export default class Header extends Vue {}
ERROR in D:/GitHub Project/pay/src/views/all_course/index.vue(11,8):
11:8 Duplicate identifier ‘Vue‘.
     9 |
    10 | <script lang="ts">
  > 11 | import Vue from "vue";
       |        ^
    12 | import { Component, Vue } from "vue-property-decorator";
    13 |
    14 | import Header from "./components/header.vue";
ERROR in D:/GitHub Project/pay/src/views/all_course/index.vue(12,21):
12:21 Duplicate identifier ‘Vue‘.
    10 | <script lang="ts">
    11 | import Vue from "vue";
  > 12 | import { Component, Vue } from "vue-property-decorator";
       |                     ^
    13 |
    14 | import Header from "./components/header.vue";
    15 | import CourseList from "./components/course_list.vue";
Version: typescript 3.5.3, tslint 5.20.1
Time: 4078ms

  App running at:
  - Local:   http://localhost:8080/
  - Network: http://192.168.31.12:8080/

这种错误一般是重复导入Vue产生的错误

原文地址:https://www.cnblogs.com/guoxinyu/p/vue-learn.html

时间: 2024-10-09 08:47:07

Vue工程报错解决方案import Vue from "vue";的相关文章

Vue的报错:Uncaught TypeError: Cannot assign to read only property &#39;exports&#39; of object &#39;#&lt;Object&gt;&#39;

Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' 1.运行一下以前的一个Vue+webpack的 vue仿新闻网站  小项目,报错 由于自己vue学习不深入,老是这个报错,找了好久(确切的说是整整一下午^...^)才找到原因 -v- Uncaught TypeError: Cannot assign to read only property 'expor

Vue.js报错Failed to resolve filter问题原因

Vue.js报错Failed to resolve filter问题原因 金刚 vue Vue.js js javascript 之前使用vue.js写分页功能时,写了一个过滤器,发现一个比较奇怪的错误. console控制台调试的时候 提示错误消息: Failed to resolve filter: HomePage console错误信息.jpg 我原来的写法: 原来的错误写法.jpg 错误原因 经过自己的摸索,后来发现竟然是代码顺序错误问题... 由于先执行的pageList,后执行的V

vue.js报错:Module build failed: Error: No parser and no file path given, couldn&#39;t infer a parser.

ERROR Failed to compile with 2 errors 12:00:33 error in ./src/App.vue Module build failed: Error: No parser and no file path given, couldn't infer a parser. at normalize (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:7051:13) at form

vue 项目报错,提示:Cannot read property &#39;$createElement&#39; of undefined at render ...

vue 项目报错,提示:Cannot read property '$createElement' of undefined at render ... vue 项目报错,提示:Cannot read property '$createElement' of undefined at render ... 原文地址:https://www.cnblogs.com/sylys/p/11956063.html

《关于vue运行报错的那些事儿》

vue运行常见报错: 一,序言: 在vue项目运行的时候,有时会报错,就会很头疼,我把常见的报错归为两类:一类是缺少依赖,一类则是找不到相关文件!我会在下方列出来我常见的关于缺少依赖型的报错,希望可以帮到大家~ 二,报错问题: 1,缺少依赖型之简单提示型,如: not find node_modules 'chalk' 解决方法:npm install chalk not find node_modules 'semver' 解决方法:npm install semver 总结一下:类似于像no

android studio - 导入工程报错[Plugin with id &#39;com.android.application&#39; not found]

出错现象: 大概意思是找不到:com.android.application 插件,以上现象对于初学者来说会经常碰到,下面分析下产生的原因. 原因分析 首先来看看导入后的工程结构: 对于此工程结构,是否有个疑问? 这是未正常同步完成的结构,Gradle Scripts下面似乎少了个 build.gradle ,上图红框部分描述清楚了是 Module: GraphicsDemo ,表示该 build.gradle 是Module的,而不是Project的.来看看一个正常的 Project+Modu

Django: __init__() missing 1 required positional argument: &#39;on_delete&#39;报错解决方案

最近在使用Python的Django框架开发web站点,通过models.py文件建表后,执行数据库迁移(命令行:mange.py makemigrations)时报错,下面是查看官方文档后找到的解决方案. 官方文档:Model field reference 报错内容: 1 class Guest(models.Model): 2 File "C:\Users\dell\guest\sign\models.py", line 18, in Guest 3 event = models

Error:Cannot build artifact &#39;XXX:war exploded&#39; because it is included into a circular dependency (artifact &#39;XXXX:war exploded&#39;, artifact &#39;XXX:war exploded&#39;) Idea启动项目报错解决方案

在Idea中使用Maven创建父子工程,第一个Model的那个项目可以很好的运行,在创建一个Model运行时报这个错.原因是tomcat部署了多个Web项目,可能最开始是两个项目的配置文件混用用,最后就报这个错. 网上找的解决方案: 步骤:File--  Porject Struccture ---- Artifacts 在Tomcat部署时war和war exploded区别: war模式:将WEB工程以包的形式上传到服务器 : war exploded模式:将WEB工程以当前文件夹的位置关系

springboot 新工程报错 Failed to configure a DataSource: &#39;url&#39; attribute is not specified and no embedded datasource could be configured.

错误日志 ... ... Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2020-04-02 12:52:47.306 ERROR 22036 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLIC