vue.js - vue-echarts 线上环境报错: Component series.line not exists...

查看:1505
本文介绍了vue.js - vue-echarts 线上环境报错: Component series.line not exists...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

本地是正常的,但一上到线上就报错:

我确实是引入了相关模块:(下面这段代码是精简过的,只表达个大概)

<template>
  <e-charts :options="echartsOption" :auto-resize="true"></e-charts>
</template>
<script>
  import ECharts from 'vue-echarts/components/ECharts.vue'
  import 'echarts/lib/component/tooltip'
  import 'echarts/lib/chart/line'
  export default{
    components: {
      ECharts,
    },
    computed:{
      echartsOption: function(){
        return {
          tooltip: {
            trigger: 'axis'
          },
          xAxis: {
            name: '时间',
            data: []
          },
          yAxis: {
            name: ''
          },
          series: [{
            name: '',
            type: 'line',
            data: []
          }]
        }
      },
    },
  }
</script>

以下是jenkins上的部分Console Output

...

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN sass-loader@3.2.3 requires a peer of node-sass@^3.4.2 but none was installed.
npm WARN vue-echarts@2.4.0 requires a peer of vue@^2.2.6 but none was installed.

....

[10.27.215.27] Executing task 'nodejs.DDist'
[10.27.215.27] Executing task 'inner_deploy'
[10.27.215.27] put: /root/.jenkins/workspace/ZDeployToOnline/Talc__master/dist.tar.gz -> ./dist.tar.gz
[10.27.215.27] run: rm -rf dist/
[10.27.215.27] run: tar -xzf dist.tar.gz
[10.27.215.27] run: mkdir -p backup/
[10.27.215.27] run: mv dist.tar.gz backup/dist.tar.gz-20170613142556
[10.27.215.27] run: ls ./ | grep ^dist.tar.gz | wc -l
[10.27.215.27] out: 11
[10.27.215.27] out: 


Done.
Disconnecting from 10.27.215.27:31109... done.
Finished: SUCCESS

报错的1.c5933c.js:formatted:4958

解决方案

我把node_modules文件夹整个删了,重新npm i后正常了。https://github.com/ecomfe/ech...

这篇关于vue.js - vue-echarts 线上环境报错: Component series.line not exists...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆