我在使用Webpack 2 + babel构建kurento-client-js时遇到了错误。
在执行时,它会产生以下结果:
WARNING in ./node_modules/kurento-client/lib/register.js
60:20-33 Critical dependency: the request of a dependency is an expression
在执行时,它会产生以下结果:
Uncaught Error: Cannot find module "."
我认为问题本身是由/lib/register.js
中的require
引起的。
//kurento-clinet/lib/register.js
if (constructor == undefined)
return register(require(name));
导致错误的代码:
//kurento-clinet/lib/index.js
//this module requires kurento-client resulting in circular reference
register('kurento-client-core')
kurento bower 包含使用 browserify 构建的分发包。
我想知道是否有人尝试过使用 webpack 构建 kurento-client-js
。请分享你的经验。
编辑:
循环依赖错误堆栈跟踪:
Uncaught TypeError: Cannot read property 'MediaObject' of undefined
at Object._typeof (KurentoClient.js:42)
at __webpack_require__ (bootstrap 0d7eac46304670c5f3b5:19)
at Object._typeof (index.js:44)
at __webpack_require__ (bootstrap 0d7eac46304670c5f3b5:19)
at Object.module.exports (HubPort.js:21)
at __webpack_require__ (bootstrap 0d7eac46304670c5f3b5:19)
at Object._typeof (index.js:32)
at ...