Uncaught TypeError: Cannot read property 'load' of undefined

A working script essentially equal to the Example Page at https://developer.mypurecloud.com/api/webchat/ stopped working for me recently. I see a console error that triggers when I call ININ.webchat.create.

It works fine if I run as an separate page on my developer machine, so I guess it some conflict on the page its embedded on is a possibility.

Just wondering if anything was recently changed in how you are supposed to embed the script via https://apps.mypurecloud.ie/webchat/jsapi-v1.js - ?

The webchat API does change from time to time. Be sure to compare what you've written to what's on the doc page you linked. If you need additional assistance, please post more information about your code and config.

I see the same error when I include the webchat js files to my production page.
It seems that there is a conflict between requirejs and the jsapi-v1.js file.

When I comment out requirejs the webchat works fine. But requirejs is needed on my production page.

Any suggestions on how to solve that?

1 Like

I can see requirejs is used in our production site as well, so likely Thomas and me are seeing the same issue here. Our web service is managed by a partner, but I'd expect to be able to drop the web chat source script in existing environments conflict-free.

We hadn't had conflicts with other 3rd party scripts, except the PureCloud web chat widget now. Any solution would be appreciated.

1 Like

Hi Tim,

Did you have a chance to look into my comment about conflicting javascript files?

It looks like joel_hellman and I are facing the same issue.

The dev team has requested that you open a ticket with PureCloud Support for this issue as they believe it is a product issue.

Hello All

We are to experiencing the same error on our Live page.@Joel@Thomas have you been successful in getting this resolved ?

If you're experiencing the same issue, please open a ticket with PureCloud Support for further investigation.

We asked our partner to open a ticket toward Genesys and they have, so it's pending investigation for now. If I get some useful info about this topic, I will share it in this thread.

This looks to be an incompatibility between a library we are using for scheduling (moment-js) our dependency loading system (lasso) and a library you are probably using for dependency loading (probably requirejs). A fix is in the works.

FYI for those following this thread, it was recently resolved on PureCloud's end, and I have confirmed the script is now working in our instance where we had the issue before. So anyone else with this issue might want to revisit and see if it might work for you now.

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