Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

TypeError: Cannot redefine property: safeSessionStorage

New Here ,
Jul 08, 2025 Jul 08, 2025

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.

TOPICS
PDF Embed API
107
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources