Utilizando la librería PDF.js Express Viewer el archivo services-worker.published.js redirecciona al index del proyecto en lugar del index de la librería, la cual se ubica en root. Para solucionar el problema se debe de incluir el seguinte código
async function onFetch(event) {
let cachedResponse = null;
if (event.request.method === ‘GET’) {
// For all navigation requests, try to serve index.html from cache,
// unless that request is for an offline resource.
// If you need some URLs to be server-rendered, edit the following check to exclude those URLs
const shouldServeIndexHtml = event.request.mode === ‘navigate’
&& !manifestUrlList.some(url => url === event.request.url)
&& !event.request.url.includes(‘/lib/ui/index’);
const request = shouldServeIndexHtml ? 'index.html' : event.request;
const cache = await caches.open(cacheName);
cachedResponse = await cache.match(request);
}
return cachedResponse || fetch(event.request);
}