Giter Club home page Giter Club logo

Comments (19)

Ovilia avatar Ovilia commented on April 27, 2024 10

@huangyangme
找到问题了,你给的例子里,ec-canvas/ec-canvas.jsimport * as echarts from './echarts';,但是 pages/line/index.jsimport * as echarts from '../../ec-canvas/echarts.simple.min';。这是不应该的,两处应该都用同样的 echarts 文件。鉴于每个 pages 里都有 echarts 的引用,所以建议下载的文件重命名为 echarts.js 放在 ec-canvas 下即可。
其他人是不是一样的原因呢?如果还有问题请继续评论。

from echarts-for-weixin.

foooooouny avatar foooooouny commented on April 27, 2024 2

将文件内 @example 处相关的注释去掉,或者直接使用压缩版的 echarts.js
wepy编译报错应该就是把 @example 处的注释编译了

* @example
 *     var Group = require('zrender/container/Group');
 *     var Circle = require('zrender/graphic/shape/Circle');
 *     var g = new Group();
 *     g.position[0] = 100;
 *     g.position[1] = 100;
 *     g.add(new Circle({
 *         style: {
 *             x: 100,
 *             y: 100,
 *             r: 20,
 *         }
 *     }));
 *     zr.add(g);

回复问题的是:

[Error] Error: 找不到模块: zrender/container/Group
被依赖于: /Users/grace/TestProjects/wepy-project/src/vendor/echarts.custom.js。
请尝试手动执行 npm install zrender/container/Group 进行安装。
    at /usr/local/lib/node_modules/wepy-cli/lib/compile-script.js:124:27
    at String.replace (<anonymous>)
    at Object.resolveDeps (/usr/local/lib/node_modules/wepy-cli/lib/compile-script.js:46:21)
    at /usr/local/lib/node_modules/wepy-cli/lib/compile-script.js:270:27
    at <anonymous>

from echarts-for-weixin.

Ovilia avatar Ovilia commented on April 27, 2024

我试了一下默认的打包项没问题,可以提供一下你选择了哪些打包项吗?

from echarts-for-weixin.

BernersH avatar BernersH commented on April 27, 2024

遇到一样的问题 请问打包项是指?

from echarts-for-weixin.

Ovilia avatar Ovilia commented on April 27, 2024

就是勾选了哪些组件?

from echarts-for-weixin.

BernersH avatar BernersH commented on April 27, 2024

只选择了折线图 别的都没勾 还试了一下默认的打包项 也是一样的错误

from echarts-for-weixin.

jackyon avatar jackyon commented on April 27, 2024

我也是一样的问题,后来实验后,发现只要不勾选“代码压缩”这一项,就能正常运行了

from echarts-for-weixin.

Ovilia avatar Ovilia commented on April 27, 2024

@jackyon 赞,我排查一下问题

from echarts-for-weixin.

Ovilia avatar Ovilia commented on April 27, 2024

@jackyon 我试了一下默认的选项,不压缩,还是没法复现

from echarts-for-weixin.

Ovilia avatar Ovilia commented on April 27, 2024

可否把有问题的 js 文件附在评论中? @jackyon @BernersH

from echarts-for-weixin.

jackyon avatar jackyon commented on April 27, 2024

echarts.txt

from echarts-for-weixin.

jackyon avatar jackyon commented on April 27, 2024

好像是 UglifyJS 压缩有问题了,我试过UglifyJS online压缩的,也是不行,后来换成: https://www.minifier.org/ 压缩,就正常了

from echarts-for-weixin.

Ovilia avatar Ovilia commented on April 27, 2024

我用你给的也是正常的。。@jackyon 你用这个项目里提供的 echarts.js 是正常的?好奇怪啊……

from echarts-for-weixin.

huangyangme avatar huangyangme commented on April 27, 2024

@Ovilia

精简版:
http://echarts.baidu.com/dist/echarts.simple.min.js

在线构建版:
http://echarts.baidu.com/builder/echarts.html?charts=line&components=gridSimple&api=true&version=4&versionCode=4.0.4

都有问题。

你可以下载以下代码运行查看。

echarts-for-weixin.zip

from echarts-for-weixin.

HuaZaiWuDi avatar HuaZaiWuDi commented on April 27, 2024

如何解决?git上面的echarts.js文件过大,在官网构建的min版本,但是报错找不到echarts.js需要改哪里嘛?

from echarts-for-weixin.

huihaitao avatar huihaitao commented on April 27, 2024

@Ovilia 请问这个代码包过大的问题是怎么解决的呢 自定义构建的js文件老是报错 @huangyangme @jackyon @HuaZaiWuDi

from echarts-for-weixin.

BoleLee avatar BoleLee commented on April 27, 2024

使用官网默认构建,将压缩勾选去掉,使用wepy编译遇到报错:

[Error] Error: 找不到模块: zrender/container/Group
被依赖于: /Users/grace/TestProjects/wepy-project/src/vendor/echarts.custom.js。
请尝试手动执行 npm install zrender/container/Group 进行安装。
    at /usr/local/lib/node_modules/wepy-cli/lib/compile-script.js:124:27
    at String.replace (<anonymous>)
    at Object.resolveDeps (/usr/local/lib/node_modules/wepy-cli/lib/compile-script.js:46:21)
    at /usr/local/lib/node_modules/wepy-cli/lib/compile-script.js:270:27
    at <anonymous>

@Ovilia 请问可能是什么原因,要怎么解决?

from echarts-for-weixin.

foooooouny avatar foooooouny commented on April 27, 2024

将文件内 @example 处相关的注释去掉,或者直接使用压缩版的 echarts.js
wepy编译报错应该就是把 @example 处的注释编译了

* @example
 *     var Group = require('zrender/container/Group');
 *     var Circle = require('zrender/graphic/shape/Circle');
 *     var g = new Group();
 *     g.position[0] = 100;
 *     g.position[1] = 100;
 *     g.add(new Circle({
 *         style: {
 *             x: 100,
 *             y: 100,
 *             r: 20,
 *         }
 *     }));
 *     zr.add(g);

from echarts-for-weixin.

jialeigd avatar jialeigd commented on April 27, 2024

将文件内 @example 处相关的注释去掉,或者直接使用压缩版的 echarts.js
wepy编译报错应该就是把 @example 处的注释编译了

* @example
 *     var Group = require('zrender/container/Group');
 *     var Circle = require('zrender/graphic/shape/Circle');
 *     var g = new Group();
 *     g.position[0] = 100;
 *     g.position[1] = 100;
 *     g.add(new Circle({
 *         style: {
 *             x: 100,
 *             y: 100,
 *             r: 20,
 *         }
 *     }));
 *     zr.add(g);

回复问题的是:

[Error] Error: 找不到模块: zrender/container/Group
被依赖于: /Users/grace/TestProjects/wepy-project/src/vendor/echarts.custom.js。
请尝试手动执行 npm install zrender/container/Group 进行安装。
    at /usr/local/lib/node_modules/wepy-cli/lib/compile-script.js:124:27
    at String.replace (<anonymous>)
    at Object.resolveDeps (/usr/local/lib/node_modules/wepy-cli/lib/compile-script.js:46:21)
    at /usr/local/lib/node_modules/wepy-cli/lib/compile-script.js:270:27
    at <anonymous>

我去 还真是这样

from echarts-for-weixin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.