polkadot-js / extension

Simple browser extension for managing Polkadot and Substrate network accounts in a browser. Allows the signing of extrinsics using these accounts. Also provides a simple interface for compliant extensions for dapps.
Apache License 2.0
974 stars 417 forks source link

Uncaught ReferenceError: localStorage is not defined #1152

Closed TJ-alchemist closed 2 years ago

TJ-alchemist commented 2 years ago

Hello, I am using localStorage similar to how it is used in the extension. I am placing it in State.ts for saving "authUrls" like in extension-base package. But am getting an error: Uncaught ReferenceError: localStorage is not defined I know localStorage cannot be used in the backend. So not sure how its working in the Polkadot extension. Can anyone guide me with the issue?

Also attaching a screenshot for the same.

oie_Q2GYRloDH8mC

TJ-alchemist commented 2 years ago

Found an alternative that works: https://www.npmjs.com/package/store2

Closing the issue.

polkadot-js-bot commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.