nerv icon indicating copy to clipboard operation
nerv copied to clipboard

引进第三方ReactPlayer报错

Open WFQX opened this issue 6 years ago • 1 comments

问题描述 引进ReactPlayer,编译成h5,报 Uncaught TypeError: Cannot add property parentVNode, object is not extensible

[或者可以直接贴源代码,能贴文字就不要截图]

config/index.js: module.exports = function(merge) { if (process.env.TARO_BUILD_TYPE === 'ui') { Object.assign(config.h5, { enableSourceMap: false, enableExtract: false, enableDll: false, }); config.h5.webpackChain = chain => { chain.plugins.delete('htmlWebpackPlugin'); chain.plugins.delete('addAssetHtmlWebpackPlugin'); chain.merge({ output: { path: path.join(process.cwd(), 'dist', 'h5'), filename: 'index.js', libraryTarget: 'umd', library: 'react-player', }, externals: { nervjs: 'commonjs2 nervjs', classnames: 'commonjs2 classnames', '@tarojs/components': 'commonjs2 @tarojs/components', '@tarojs/taro-h5': 'commonjs2 @tarojs/taro-h5', weui: 'commonjs2 weui', }, }); }; } if (process.env.NODE_ENV === 'development') { return merge({}, config, require('./dev')); } return merge({}, config, require('./prod')); };

系统信息

  • Taro 版本 [e.g. v.1.1.4]
  • 报错平台 [h5]

补充信息 自定义音频UI,audio不支持initialTime,引进ReactPlayer

WFQX avatar Nov 21 '18 06:11 WFQX

同样也碰到这个问题了,有临时绕过方法吗?

Jeff-Tian avatar Feb 21 '20 12:02 Jeff-Tian