Adobe PDF Embed API Error
We have recently tried migrating our website from Gatsby Cloud to Netlify.
On our site we have the Adobe PDF viewer embedded in a component which is used for all our publications and other pdf files.
This has been working absolutely fine for a long time.
Switching to Netlify hosting and pointing the dns to Netlifies servers broke the pdf viewer and it now no longer shows the PDF’s.
For context we had to changed our primary domain name from the apex domain as suggested by Netlify to take advantage of their Load Balancers.
We tried setting up a further instance of the PDF Embed service with a new API key on the www. domain but we still saw errors.
The normal Unauthorised error did not show and the player shows the loading spinner but once complete we just see a blank box and the following js errors in the console.
Console log first logs:
rendering worker created
TypeError: e.lastIndexOf is not a function - dc-core.js:2
at getNamePartsFromFullName (bootstrap.js:2:930556)
at bootstrap.js:2:2750845
at r.value (dc-mobx.js:2:22647)
at Object.allowStateChanges (dc-mobx.js:2:83931)
at dc-mobx.js:2:25072
at Qt (dc-mobx.js:2:76193)
at e.track (dc-mobx.js:2:78802)
at r.l [as render] (dc-mobx.js:2:25003)
at kj (dc-core.js:2:320948)
at ij (dc-core.js:2:320746)
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘0’) - bootstrap.js:2
at getTimingsToLogWithFirstPageLoad (bootstrap.js:2:940632)
at bootstrap.js:2:574210
at <anonymous>
A Warning 4 times:
[mobx.array] Attempt to read an array index (0) that is out of bounds (0). Please check length first. Out of bound indices will not be tracked by MobX
Occasioinally but not always:
Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' use.typekit.net assets.adobedtm.com www.adobe.com/marketingtech/ prod.adobeccstatic.com/utilnav/ widget.uservoice.com by2.uservoice.com/t2/ assets.adobe.com api.demandbase.com/api/v2/ip.json commerce.adobe.com". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.
We decided to roll back the DNS to point to Gatsby Cloud while we looked into this. However rolling back to Gatsby we were still seeing the error. Even though nothing had been changed in the Gatsby set up or with the original PDF Embed credentials. So there should be no reason why this should now no longer be working.
This is business critical as we have many pdf’s embedded on the site. So we have currently added a fix to the live site to just download them. So you will not see the viewer on our main domain currently. However the Netlify site does have it and will become our main site as we are being forced to move to Netlify as they are closing Gatsby Cloud down which means we need a solution to fix this to work on Netlify on the www. Domain.
Any direction on resolving will be greatfully received.
