Skip to content

Gotchas, Tips, and Tricks

Edward Silverton edited this page Feb 20, 2023 · 13 revisions

Use npm link to test components

cd ./iiif-av-component

npm link

npm i

npm run build

cd ../universalviewer

npm link @iiif/iiif-av-component

run npm run build:esmodule -- --watch in manifesto and manifold

If you run npm i in universalviewer after linking the links break, so run npm link again.

npm link isn't working

If you're having problems with npm link, you can replace the package.json entries for @iiif/manifold, manifesto.js etc with:

"@iiif/manifold": "file:../../iiif-commons/manifold",

"manifesto.js": "file:../../iiif-commons/manifesto",

Note that manifold must also use the file link to manifesto. You also need to run npm run build on both libraries.

Cannot read properties of undefined (reading 'substr')

If you're getting an error saying Cannot read properties of undefined (reading 'substr') at normaliseUrl , it could be that your info.jsons aren't available over the network.

Ruby on Rails

Use this Gem to add the UV to your Rails project: https://github.com/pulibrary/pul_uv_rails

For cache invalidation outside of the Rail's asset pipeline, you can symlink a checksum of the UV source. https://github.com/sul-dlss/sul-embed/pull/860

Your log-in attempt did not appear to be successful. Please try again

If you're seeing this error message, you need to ensure that the server hosting your manifest has the correct CORS settings. It cannot use a wildcard (*) in the Access-Control-Allow-Origin CORS header - it must include the domain that is making the request. So if https://universalviewer.io is accessing https://myiiifmanifests.com, https://myiiifmanifests.com must include https://universalviewer.io in its Access-Control-Allow-Origin CORS response header.