Webpack fails with "module not found' error

Hello,

I am trying to incorporate the purecloud-platform-client-v2 in my React/Redux app. When I simply reference the following:
var platformClient = require('purecloud-platform-client-v2')
or
import platformClient from 'purecloud-platform-client-v2';

I get the error when I run any webpack commands (see below).
This error is repeated for each function referenced in the src/purecloud-platform-client-v2/index.js file.

I know you can load the purecloud-platform-client-v2 via CDN, but I would prefer to use NPM.

What is causing the issue?

What additional information do you need from me?

~ Thanks!

Webpack commands:
"scripts": {
"dev": "webpack-dev-server --content-base src --inline --hot",
"error": "webpack --display-error-details",
"bundle": "webpack",
"prod": "webpack -p"
},

Error:
ERROR in ./node_modules/purecloud-platform-client-v2/src/purecloud-platform-client-v2/index.js
Module not found: Error: Can't resolve 'purecloud-platform-client-v2/api/OAuthApi' in '/home/xxxx/LM/node_modules/purecloud-platform-client-v2/src/purecloud-platform-client-v2'
@ ./node_modules/purecloud-platform-client-v2/src/purecloud-platform-client-v2/index.js 4:4-2178
@ ./src/js/actions/v2contactListActions.js
@ ./src/js/components/auth/loginMain.js
@ ./src/js/pages/routes.js
@ ./src/js/client.js
@ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server babel-polyfill ./js/client.js

I don't know what the issue is with webpack (haven't looked yet), but that will be a consideration for some work I'm doing to make packaging improvements to the JavaScript SDK.

So this sounds like a work in progress? I am new to PureCloud and wasn't sure if I had missed something..

Yep, in progress. The current SDK was only tested for compatibility with current browsers and node.js. Trying to add more flexibility.

Okay, gotcha. Do you need any help?

Appreciate the offer! Once I get the initial work done, I'll make a post here on the forum to enlist community members to help test in their environments before officially releasing the changes. CX18/devcon is next week, so keep an eye out for the post in mid-May.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.