Scott_Jones | 2018-04-23 20:10:08 UTC | #1
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 ./nodemodules/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/nodemodules/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
tim.smith | 2018-04-23 20:18:49 UTC | #2
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.
Scott_Jones | 2018-04-23 20:36:03 UTC | #3
So this sounds like a work in progress? I am new to PureCloud and wasn't sure if I had missed something..
tim.smith | 2018-04-23 20:53:53 UTC | #4
Yep, in progress. The current SDK was only tested for compatibility with current browsers and node.js. Trying to add more flexibility.
Scott_Jones | 2018-04-23 22:10:54 UTC | #5
Okay, gotcha. Do you need any help?
tim.smith | 2018-04-24 15:57:52 UTC | #6
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.
system | 2018-05-25 15:57:52 UTC | #7
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 2776