Closed lulu3976003 closed 7 years ago
能发发一下你完整的能复现的项目
自己定位了一下错误 我这个是vue-cli搭建的项目 现在是只要引用echarts 第一次进没有问题 刷新就会报上面的图的错误 500的错误 不引入没问题
这个是编译时的环境变量,如果你是 webpack 的话可以考虑参考 https://github.com/ecomfe/echarts/blob/master/webpack.config.js#L7 加入
老铁我跟你是一样的问题,有什么解决的方法啊
还是不行。是我没改对么。。。我在webpack.base.conf.js里面加了var webpack = require("webpack")
,
I have the same issue but I am using angular cli. Should I define this DEV variable somewhere like the environment.ts or environment.prod.ts ?
我的问题和vue中 import 失败 #6987是一样的,用的也是vue2.但是我按照里面的方法试了一遍还是不行,老铁会说中文么。
@zsychy 在 webpack的配置里面加一个配置
plugins: [
new webpack.DefinePlugin({
__DEV__: false
})
]
我加了,但是我不知道加在那一块里面。。可能没加对地方。。 @hefeng1208
@zsychy webpack.base.conf.js 或者说你的配置文件里面 设置插件的地方
是module下面的rules块里面么。。。萌新没设置过插件
就是在build\webpack.dev.conf.js 里面的plugins参数
angular4也是一样的问题,echarts最新版本
function enableClassExtend(RootClass, mandatoryMethods) {
RootClass.$constructor = RootClass;
RootClass.extend = function (proto) {
if (__DEV__) {
__WEBPACK_IMPORTED_MODULE_0_zrender_src_core_util__["each"](mandatoryMethods, function (method) {
if (!proto[method]) {
console.warn(
'Method `' + method + '` should be implemented'
+ (proto.type ? ' in ' + proto.type : '') + '.'
);
}
配置了 // 定义环境变量
new webpack.DefinePlugin({
PRODUCTION: JSON.stringify(PRODUCTION),
DEVELOPMENT: JSON.stringify(DEVELOPMENT),
__DEV__: false
}),
不起作用
@xiguayizu,@hefeng1208,@darkurse, 谢谢各位大佬。。。vue2下面是build\webpack.dev.conf.js,不是Base
我刚才使用3.8版本,也遇到这个问题了 https://github.com/ecomfe/echarts/issues/7000, 使用老版本解决了 cnpm i echarts@3.7.2
我们在新发布的 3.8.2 中将 lib 下的重新转译成了 CommonJS 格式并且去掉了 DEV,应该解决了大家构建的兼容问题。非常抱歉新版本的模块系统给大家造成了这么大的麻烦。
刚升级了 3.8.2 没问题了,辛苦!
@pissang 是不是对应的像echarts-for-react,或者react-native的包他们的依赖都要更新一下,不然还是不行呢~
@KaroseLiu 应该不需要,只要不要安装到 3.8.0 就行了
@pissang老铁。。我现在更新到3.8.2了。但是我type:line的时候报错undefined的了。
3.8.0版本的echarts地图都不出来,一直在报TypeError: targetList is undefined的错@pissang
font{
line-height: 1.7;
}
ul,ol{
list-style-position: inside;
}
可以升级一下版本试试
a#ntes-pcmail-signature-default:hover {
text-decoration: underline;
color: #199cff;
cursor: pointer;
}
a#ntes-pcmail-signature-default:active {
text-decoration: underline;
color: #246fce;
cursor: pointer;
}
在2017年11月13日 17:38,raindew2016<notifications@github.com> 写道:
3.8.0版本的echarts地图都不出来,一直在报TypeError: targetList is undefined的错
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
One-line summary [问题简述]
vue项目 webpack 引入 echarts 第一次进如没有问题 刷新就会报错500 显示DEV not defined
Version & Environment [版本及环境]
Expected behaviour [期望结果]
ECharts option [ECharts配置项]
Other comments [其他信息]