Circular references in Webpack build of kurento-client-js

Viewed 694

I'm facing an error while trying to build kurento-client-js with Webpack 2 + babel.

WARNING in ./node_modules/kurento-client/lib/register.js
60:20-33 Critical dependency: the request of a dependency is an expression

On execution it results in

Uncaught Error: Cannot find module "."

I believe that the issue itself is сaused by require inside /lib/register.js

//kurento-clinet/lib/register.js
if (constructor == undefined)
    return register(require(name));

And the code that cause errors:

//kurento-clinet/lib/index.js
//this module requires kurento-client resulting in circular reference
register('kurento-client-core') 

The kurento bower package contains distributive built with the browserify.

I wonder if anyone tried to build kurento-client-js using webpack. Please share your experience.

EDIT:

Circular dependency error stack trace:

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 ...
1 Answers
Related