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.
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
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.
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';
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
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.
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.
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
Cheered too soon , 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)
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
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?
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.