Legacy Dev Forum Posts

 View Only

Sign Up

Error importing javascript SDK

  • 1.  Error importing javascript SDK

    Posted 06-05-2025 18:01

    Herlander_Pires | 2017-08-03 10:16:47 UTC | #1

    Hello,

    I'm trying to import the javascript SDK like in https://developer.mypurecloud.ie/api/rest/client-libraries/javascript-noborder/index.html tutorial, but without success. After included the html import and triggered the function with the code in section "Web Implicit Grant", the console browser retrieves the following error:

    Uncaught Error: Cannot find module 'purecloud-platform-client-v2' * at s (purecloud-platform-client-v2.min.js:1)* * at s (purecloud-platform-client-v2.min.js:1)*

    Thank you in advance.


    tim.smith | 2017-08-03 14:29:17 UTC | #2

    Hm, that's certainly not good. I've created API-2761 and will look into this ASAP.


    Herlander_Pires | 2017-08-03 14:38:06 UTC | #3

    Ok, i wait for it.

    Thank you and best regards.


    tim.smith | 2017-08-03 15:36:29 UTC | #4

    Turns out it was just a documentation issue. Instead of:

    const platformClient = require('purecloud-platform-client-v2');

    use the module name platformClient. The module name above is for node, the one below is for the web module.

    const platformClient = require('platformClient');

    Additionally, I found a bug that was just recently introduced due to adding a custom header to the SDK. I've fixed that as of v. 6.1.5. Here's the link to the CDN; the documentation is currently in the process of deploying to the dev center.

    <script src="https://sdk-cdn.mypurecloud.com/javascript/6.1.5/purecloud-platform-client-v2.js"></script>

    Herlander_Pires | 2017-08-03 17:04:59 UTC | #5

    That was it

    Thank you and regards


    system | 2017-09-03 17:05:11 UTC | #6

    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: 1642