“Hmm… looks like this file doesn’t have preview we can show you”

Microsoft allows you to embed previews of a document stored in SharePoint Online / OneDrive inside your site web page.

There is an API (driveItem: preview – Microsoft Graph v1.0) that allows you to obtain short-lived embeddable URL to render document preview. 

Recently some of out users complained that they no longer see previews. Instead, they see very interesting message “Hmm… looks like this file doesn’t have preview we can show you”.

If you try to Google this issue you won’t find much, but if you bing it you will find few questions on MS Tech Community site that aren’t really helpful.

Let’s open Edge/Chrome dev tools (F12) and find out what is going on. On the network tab, I found few failed requests (related to online preview) with 404 status code. 

Network tab of browser dev tools

What interesting about this image is that the response comes from ServiceWorker (and not from actual backend). This means that your browser has service worker installed for SharePoint Online that intercept request to the server and reply with 404 instead of passing the request to server.

Solution

We need to find and remove service worker that break our previews.

All registered service workers

Find service worker registered for your SharePoint Online tenant (*.sharepoint.com) and Unregister it.

Unregister *.sharepoint.com service worker

That it, next time when you reload page with web preview, it should work.

When you visit web preview of a document in SharePoint Online it most likely register the service worker again, but new one should not break your previews.

2 thoughts on ““Hmm… looks like this file doesn’t have preview we can show you”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s