WebViewer WebComponent mode has dependency conflicts

WebViewer Version: 11.0

Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? No
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? Yes?
Is your issue related to annotations? No

Please give a brief summary of your issue:
WebViewer WebComponent mode has dependency conflicts

Please describe your issue and provide steps to reproduce it:
We are now trying WebComponent mode in our labs and we are running into several issues. While some of them look solvable by minor css adjustments, one severe issue is it seems WebViewer is importing something that overwrites the use of the understore globally across the page. This is the error we get when the WebViewer initializes:

Our application currently has lodash 4.17.21 as a dependency and we would like to know if there’s any way to get around this. Deprecating the use of lodash is not an option on the table for our product development team at the moment.

Thank you!

Please provide a link to a minimal sample where the issue is reproducible:

1 Like

EDIT: To clarify, our application is defining lodash mixins as follows:
image

It seems WebViewer in WebComponent mode is resetting the lodash mixins therefore we lose reference to these in our application. Then is there a way for the lodash used by WebViewer to just initialize from within the WebComponent only so that it does not affect the lodash loaded globally in the page?

1 Like

Hello Rafael,

Could you provide a minimal sample project to reproduce the issue? A minimal sample refers to a simplified version of your project where unrelated/unnecessary code has been removed. You can attach your project or provide us with a download link or GitHub repo. We have a sample React WebViewer project you can use as a template here: GitHub - ApryseSDK/webviewer-react-sample: Sample to demonstrate integrating WebViewer into React

In addition, you could also try using noConflict or runInContext in the Lodash library to see if that prevents your Lodash mixins from getting reset.

Best Regards,
Darian

1 Like