Copy link to clipboard
Copied
I am receiving the following error in my .NET Framework MVC project when I load a page which has the Embed PDF API scripts. I asked CoPilot to analyze. Here's a snippet:
The error TypeError: Cannot redefine property: safeSessionStorage occurs because the Object.defineProperty method is being used to define a property (safeSessionStorage) that already exists and is non-configurable. Non-configurable properties cannot be redefined or modified.
The root cause likely lies in the initializeStorage function, which attempts to redefine the safeSessionStorage property. Without access to the full implementation of initializeStorage or the context in which it is called, it is challenging to pinpoint the exact issue. However, it is possible that the property was previously defined as non-configurable, either by the same codebase or an external library.
The issue happens in a script loaded from Adobe's site called "StorageHelper.js". The code in question is on line 45:
Object.defineProperty(window.adobe_dc_sdk, 'safeSessionStorage', {
value: safeSessionStorage,
writable: false,
});
I'm currently running it on a local network and have created a seperate key for running in this environment. Everything worked fine when I set it up the first time. Now I'm making edits to the page and when I debug, it keeps catchng this error. The work around for now is to either comment out the script or disable javascript debugging. Anyone have experience with this issue? Thanks.
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now