Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h5调试chooseImage模拟报错 #2758

Closed
linrf opened this issue Apr 13, 2019 · 15 comments
Closed

h5调试chooseImage模拟报错 #2758

linrf opened this issue Apr 13, 2019 · 15 comments

Comments

@linrf
Copy link

linrf commented Apr 13, 2019

问题描述
chooseImage模拟报错

复现步骤
启动h5调试就报错了

期望行为
[这里请用简洁清晰的语言描述你期望的行为]

报错信息
image

图片好像报错了。
Uncaught TypeError: Cannot redefine property: chooseImage

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。

  • 操作系统: Mac
  • Taro 版本 👽 Taro v1.2.0-beta.11
  • Node.js 版本 10.10.0
  • 报错平台 h5

补充信息

@taro-bot
Copy link

taro-bot bot commented Apr 13, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@freeler
Copy link

freeler commented Apr 13, 2019

同样的错误,泪奔中~

@luckyadam
Copy link
Member

贴一下使用代码

@linrf
Copy link
Author

linrf commented Apr 13, 2019

贴一下使用代码

代码里并没有使用chooseImage这个方法。看了下应该是挂载在Taro对象上的。引入方式很常规

import Taro, { Component } from '@tarojs/taro'

这是我的项目依赖,看下是不是和这个有关?

	"dependencies": {
		"@tarojs/async-await": "1.2.3",
		"@tarojs/components": "1.2.3",
		"@tarojs/redux": "1.2.3",
		"@tarojs/redux-h5": "1.2.3",
		"@tarojs/router": "1.2.3",
		"@tarojs/taro": "1.2.3",
		"@tarojs/taro-alipay": "1.2.3",
		"@tarojs/taro-h5": "1.2.3",
		"@tarojs/taro-swan": "1.2.3",
		"@tarojs/taro-weapp": "1.2.3",
		"dva-core": "^1.4.0",
		"dva-loading": "^2.0.6",
		"html2json": "^1.0.2",
		"mocker-api": "^1.6.6",
		"nerv-devtools": "^1.3.9",
		"nervjs": "^1.3.9",
		"redux": "^4.0.0",
		"redux-logger": "^3.0.6",
		"redux-thunk": "^2.3.0",
		"showdown": "^1.9.0"
	},

目前我先降级回1.2.3了,因为正在联调。。

@luckyadam
Copy link
Member

升级的话 cli 和项目依赖要保持一致

@linrf
Copy link
Author

linrf commented Apr 13, 2019

升级的话 cli 和项目依赖要保持一致

我是在项目里执行的npm update,是指需要单独升级cli的版本么?

@luckyadam
Copy link
Member

你在项目里执行 npm update 只会升级本地项目依赖,安装的 taro cli 也要升级啊

@linrf
Copy link
Author

linrf commented Apr 13, 2019

你在项目里执行 npm update 只会升级本地项目依赖,安装的 taro cli 也要升级啊

这有点反逻辑啊。。并不是大版本的升级,居然强关联么。。

@luckyadam
Copy link
Member

那你可以把 cli 安装到本地啊,哪里反逻辑?

@linrf
Copy link
Author

linrf commented Apr 13, 2019

那你可以把 cli 安装到本地啊,哪里反逻辑?

我是安装到本地的。。

@luckyadam
Copy link
Member

那你检查一下版本有没有对上

@linrf
Copy link
Author

linrf commented Apr 13, 2019

👽 Taro v1.2.24

Taro CLI 1.2.24 environment info:
System:
OS: macOS 10.14.4
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.10.0 - /usr/local/bin/node
Yarn: 1.10.1 - ~/.npm-global/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
npmPackages:
@tarojs/async-await: 1.2.25 => 1.2.25
@tarojs/components: 1.2.25 => 1.2.25
@tarojs/plugin-babel: 1.2.25 => 1.2.25
@tarojs/plugin-csso: 1.2.25 => 1.2.25
@tarojs/plugin-less: 1.2.25 => 1.2.25
@tarojs/plugin-uglifyjs: 1.2.25 => 1.2.25
@tarojs/redux: 1.2.25 => 1.2.25
@tarojs/redux-h5: 1.2.25 => 1.2.25
@tarojs/router: 1.2.25 => 1.2.25
@tarojs/taro: 1.2.25 => 1.2.25
@tarojs/taro-alipay: 1.2.25 => 1.2.25
@tarojs/taro-h5: 1.2.25 => 1.2.25
@tarojs/taro-swan: 1.2.25 => 1.2.25
@tarojs/taro-weapp: 1.2.25 => 1.2.25
@tarojs/webpack-runner: 1.2.25 => 1.2.25
eslint-config-taro: 1.2.25 => 1.2.25
eslint-plugin-taro: 1.2.25 => 1.2.25
nervjs: ^1.3.9 => 1.3.13

似乎cli最新版本就是1.2.24?
这是我npm i -g @tarojs/cli@latest => taro update project => taro info拿到的信息。
重装依赖后,依然报错

@wycfcqt
Copy link

wycfcqt commented Apr 13, 2019

项目依赖和全局cli版本保持一致了,仍然会报这个错,今天刚升级了1.2.25才出现这个问题的

@linrf linrf changed the title chooseImage模拟报错 h5调试chooseImage模拟报错 Apr 14, 2019
@yanyue404
Copy link

yanyue404 commented Apr 15, 2019

  • 版本信息均已升级到 1.2.25
👽 Taro v1.2.25


  Taro CLI 1.2.25 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 10.13.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.12.3 - D:\Alike\yarn\bin\yarn.CMD
      npm: 6.9.0 - ~\AppData\Roaming\npm\npm.CMD
  • h5 编译报错
/* 未支持的api */
export * from './unsupportedApi'

/* 已实现api */
export * from './canvas'
export * from './createAnimation'
export * from './createSelectorQuery'
export * from './imageUtils'
export * from './interactive'
export * from './navigationBar'
export * from './others'
export * from './pullDownRefresh'
export * from './request'
export * from './storage'
export * from './system'
export * from './tabBar'
export * from './videoUtils' // Error:  Uncaught TypeError: Cannot redefine property: chooseImage
export * from './webSocket'

export * from './privateApis'

解决方法tarojs/cli与项目taro依赖版本回退至 1.2.23

👽 Taro v1.2.23


  Taro CLI 1.2.23 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 10.13.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.12.3 - D:\Alike\yarn\bin\yarn.CMD
      npm: 6.9.0 - ~\AppData\Roaming\npm\npm.CMD

@Littly
Copy link
Contributor

Littly commented Apr 15, 2019

是个bug 1.2.26已修复~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants