npm - QuickBlox JavaScript SDK in Angular 4 -


i try use quickblox javascript sdk in angular 4 browser app.

at first created new project using angular-cli. installed quickbox using

npm install quickblox --save 

in app.component.ts added import

import { qb } 'quickblox'; 

when try use qb in code webpack fails compile following error:

error in ./~/node-xmpp-client/lib/client.js module not found: error: can't resolve 'child_process' in 'c:\dev\workspace_js\qb\node_modules\node-xmpp-client\lib'  @ ./~/node-xmpp-client/lib/client.js 15:11-35  @ ./~/node-xmpp-client/index.js  @ ./~/quickblox/src/modules/qbchat.js  @ ./~/quickblox/src/qbmain.js  @ ./src/app/app.module.ts  @ ./src/main.ts  @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts 

i tried add qb app.module.ts, installed node-xmpp-client package nothing works. maybe import statement wrong? docs shows how use require.

how can use quickblox angular 4? can use npm package client side (browser) application?

of course, doesn't seem best fix. anyway can rid of issue adding

module.exports.node = {   child_process: 'empty' } 

in webpack config.since not better idea modify third party library


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -