Issue with the a dependency npm package for the sdk

Hi,

Currently we are integrating Genesys in our new stack and we are using es modules, instead of webpack to build our project. Our issue is with the dependency genesys-cloud-streaming-client, which has an incorrect path in the package.json as it's point to a file, that doesn't exist.

If we look into the changes of this repo, we can see that there has been changes on the build scripts for this specific package. Can you please investigate and fix the module part of this package and release an update?

The error we get when building is:
Failed to resolve entry for package "genesys-cloud-streaming-client". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "genesys-cloud-streaming-client". The package may have incorrect main/module/exports specified in its package.json.

Thanks!

Kind regards Dave

Dave thanks for letting us know. Which version are you trying to use? I know we fixed a build issue regarding the package.json files in this most recent release or the one before which may fix your issue.

No problem! We are using version 6.1.2 for the webrtc package and that one is using version 13.2.8 of the cloud streaming agent. It looks like there is a minor update available, so will update and confirm if it works or not. Thank you for the reply

Hi @jensen.gar ,

I've looked into the release that has been made, but that doesn't include any fix for our issue. The module we need is not included into the dist folder.

Thanks Dave, I'll get someone looking into this.

Hey @davie, I took a look and was curious if you knew which file was incorrectly pointed. We have found an issue with the following in the genesys-cloud-streaming-client:

package.json -> "browser": "dist/streaming-client-browser.js",
webpack.config.js -> let filename = 'streaming-client.browser.js';

Hi Zach,

It's the "module" field in the package.json, we are not using webpack but esbuild

Hi Davie,

I just chatted with Zach about this. Looks like they have figured out a fix and it is working on a change management ticket to get it approved and released. Once he has done that he will update this forum post.

Thanks,
John Carnell
Manager, Developer Engagement

1 Like

Hi Dave,

I apologize for this taking some time, we ran into some other issues along the way. The fix for this has just been released in genesys-cloud-webrtc-sdk version 6.1.3.

Let me know if you have any other issues or questions.

Thanks,
Zach

Hi Zach,

Sorry for the late reply, but just tested it and it doesn't work yet. Complaining about missing imports from stanza.

also it seems like the npm package (tgz with version 6.1.4) is not reachable. I'm reveiving a 404 with installing that version.

Kind regards,

Dave

Dave, I know it's a big ask, but can you put together a simple app and share it with us so we can see what you're seeing? We are attributing the 404 with version 6.1.4 to npm's recent outage and have opened a case with them, however we expected 6.1.3 to have fixed your problem and don't see anything in 6.1.4 that would address what you are seeing.

Hi Jensen,

I was busy creating an example to share here and spotted that the build issues for esbuild are mostly resolved by version 6.1.6 or the 6.1.4. Now only one issue remained about eventEmitter being imported, but not exported.

I narrowed it down to one of your dependencies called stanza and fixed it, by installing the dependency they use for event emitter.

Error before installing events package:
'EventEmitter' is not exported by __vite-browser-external, imported by node_modules/stanza/module.js`

Still need to test it first, to make sure all is fixed

Hi Jensen,

Cheered too soon :frowning: , however we are getting there. You could test by yourself, by creating a new project in vite and install the dependencies. Was creating it, but you need a token, so it might be better for you to create a local project and test it out.

In steps:
create a vitejs project (we use typescript)

yarn create vite

after creating it, install:

yarn add genesys-cloud-webrtc-sdk purecloud-platform-client-v2 -D

then configure your project by importing and configuring.

Hi Davie,

We are currently taking a look at this and will provide an update once we are able to :slight_smile:

Hi Dave @davie

One of our developers whipped a solution that works for us locally. If you follow this link it will take you to the open PR to introduce the fix into SDK. There are steps to follow in it to test the fix locally for yourself and see if it works for you as well.

Let us know if there are still issues or any clarifications are needed

Hi,

We tested the solution and we are able to build and serve with genesys now. Did see we get everything now in the index, is this something that will get optimised in the future?

Hi Dave,

I'm glad to hear you're able to build and serve! As for the optimization, that is something we can look into and work on. Any updates on that front, we will pass along to you.

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