Copy link to clipboard
Copied
Hi,
yesterday my PDF Embed API stopped working properly for no reason.
If I load it more than once in the same page, without refreshing, it gives me the error 'index.js:44 Uncaught dc-core loaded twice'.
I didn't edit anything about it.
This is the code:
This is the log:
index.js:44 Uncaught dc-core loaded twice
haRa @ index.js:44
__webpack_require__ @ bootstrap:19
EbfC @ AdobeDCViewBase.js:13
__webpack_require__ @ bootstrap:19
(anonymous) @ ViewSDKInterface.js:2
(anonymous) @ ViewSDKInterface.js:2
(anonymous) @ ViewSDKInterface.js:2
Any suggestions gratefully received.
Cheers, Daniel
Copy link to clipboard
Copied
I'm on the road this week, but will try to look early next week.
Copy link to clipboard
Copied
The following snippet is what is causing the error for me. Is there something wrong with this check? How do I properly setup the sdk in my react app so that I don't trigger this error? My use case involves loading a pdf document and re render it whenever the pdf has been updated.
// Check that dc-core has been built properly
window.adobe_dc_sdk = window.adobe_dc_sdk || {};
if (window.adobe_dc_sdk['dc-core-loaded']) {
// normally this means that dc-core has been statically linked
throw 'dc-core loaded twice';
}
window.adobe_dc_sdk['dc-core-loaded'] = true;
Copy link to clipboard
Copied
window.adobe_dc_sdk = window.adobe_dc_sdk || {};
window.adobe_dc_sdk['dc-core-loaded'] = false;
For now I am doing this and it's working fine. I am not sure about the potential issues that can arise. If there is anything, kindly let me know. Thanks!
Copy link to clipboard
Copied
Any update on this yet, I am also facing the same issue.
Copy link to clipboard
Copied
Not sure how relevent this is, but while I was trying to delete the script element I noticed that it's parentNode is null and as per my reading that could be an issue with the library?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more