0

enter image description here

I have the modules as shown above. I need to include not only quickblox, but the quickblox.chat plugin.

I'm using this code:

// Quickblox var QB = require('quickblox'); var QBChat = require('quickblox/plugins/chat'); 

quickblox loads fine but quickblox/plugins/chat throws:

Error: Cannot find module 'quickblox/plugins/chat' 

Here is the package.json included in the quickblox/plugins/chat directory:

 { "name": "quickblox.chat", "description": "Quickblox Javascript SDK / XMPP Chat plugin", "version": "0.8.6", "author": "Andrey Povelichenko <[email protected]>", "homepage": "http://quickblox.com/developers/Web_XMPP_Chat_Sample" } 

1 Answer 1

1

If you call require with a folder path, it tries to load index.js, which doesn't exist.

var QBChat = require('quickblox/plugins/chat/quickblox.chat'); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.