Universal Viewer

116 views
Skip to first unread message

achille tindo

unread,
Mar 6, 2024, 5:01:48 PM3/6/24
to Universal Viewer
Hello,

I have a project now and I want to integrate Universal Viewer into React website but I haven't managed it yet. Can one of you please show me a tutorial or a concrete example of how I can do this?

Best regards
Achilles

Demian Katz

unread,
Mar 7, 2024, 6:36:31 AM3/7/24
to achille tindo, Universal Viewer

Achilles,

 

I have not done this personally, but I feel like there is some React experience within the community. I was surprised to find that we don’t yet have a React example on our examples page here:

 

https://github.com/UniversalViewer/universalviewer/wiki/UV-Examples

 

…but maybe somebody who has done this would be willing to add one! I’ll try to remember to ask on the Community Call today. (You’re also welcome to join the call if you’re interested and the timing works out – it’s usually the first Thursday of the month. You can find the exact time in your local time zone (and the Zoom link) if you scroll down to the calendar on this page:

 

https://iiif.io/community/groups/#community-groups

 

- Demian

--
You received this message because you are subscribed to the Google Groups "Universal Viewer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to universalview...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/universalviewer/3e7f661f-5394-4399-a58f-a5cb7afff832n%40googlegroups.com.

Demian Katz

unread,
Mar 7, 2024, 8:02:26 AM3/7/24
to achille tindo, Universal Viewer

Achilles,

 

Ed Silverton pointed out that the NextJS example (on the page I linked below, and also directly linked at https://codesandbox.io/s/uv-nextjs-example-uh9zi) shows a way of running UV inside a React app. I hope that is helpful!

 

- Demian

achille tindo

unread,
Mar 7, 2024, 8:10:19 AM3/7/24
to Universal Viewer
Damian,

Thank you very much for trying to help me further. The problem is, I saw  Ed Silverton  's example, but when I try to integrate locally I always get the error:
ERROR in ./node_modules/universalviewer/dist/esm/chunk-4BC26SXO.js 3308:44-94
Module not found: Error: Can't resolve '../../extensions' in 'C:\Users\Lenovo\Desktop\type\mein-projekt\node_modules\universalviewer\dist\esm'
ERROR in ./node_modules/universalviewer/dist/esm/chunk-4BC26SXO.js 3314:20-59
Module not found: Error: Can't resolve '../../../../locales' in 'C:\Users\Lenovo\Desktop\type\mein-projekt\node_modules\universalviewer\dist\esm'
I also tried contacting  Ed Silverton   but to no avail.

Demian Katz

unread,
Mar 7, 2024, 8:15:38 AM3/7/24
to achille tindo, Universal Viewer

Achilles,

 

Unfortunately, Ed is engaged on a different project right now, so his Universal Viewer time is quite limited for the next few months. I’m doing my best to help with support when I can, but my expertise is not so broad. 😊

 

Which version of the viewer are you trying to use? It might be useful to compare the version in Ed’s example against your own version, in case there’s a problem with the specific version you are using. There were recently some issues that were impacting Vite users, and I imagine you might be running into the same thing. If that’s the case, either upgrading or downgrading might help (and if upgrading doesn’t help, there may be some bug that still needs to be fixed).

achille tindo

unread,
Mar 7, 2024, 12:50:33 PM3/7/24
to Universal Viewer
Thank you again for your valuable help. I use the version:

react: 18.2.0
react-dom: 18.2.0
react-scripts: 5.0.1
typescript: 4.9.5
universalviewer: 4.0.25
web-vitals: 2.1.4

and Ed uses the version:

react: 18.0.0
react-dom: 18.0.0
react-scripts: 4.0.3
universalviewer: 4.0.9

maybe that's the problem?

Demian Katz

unread,
Mar 7, 2024, 3:54:35 PM3/7/24
to achille tindo, Universal Viewer

It is possible that the problem has to do with using version 4.0.25. Have you tried just downgrading the UV to 4.0.9 to see if that makes a difference? I believe that some bugs have been fixed subsequent to the 4.0.25 release, but 4.0.26 has not been released yet. If you can confirm that 4.0.9 works, that would be a further indication that we should try to get a new bug-fix release issued as soon as practical. 😊

achille tindo

unread,
Mar 7, 2024, 6:18:58 PM3/7/24
to Universal Viewer

I would have liked to say that it works, but it still doesn't work even with version 4.0.9

Demian Katz

unread,
Mar 8, 2024, 8:26:32 AM3/8/24
to achille tindo, Universal Viewer

I guess to take this one step further: does it work for you with the exact same set of dependencies that Ed used? If so, it would be interesting to update them one at a time to identify which one is breaking. If it doesn’t work at all, then that raises a different set of questions, of course. 😊

Reply all
Reply to author
Forward
0 new messages