You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am also facing the same problem.
If I ams importing it as import SecureLS from 'secure-ls', then it throws error
ReferenceError: localStorage is not defined
at new SecureLS (C:\Users\Lui\Desktop\PO\purchase-order\frontend\node_modules\secure-ls\dist\secure-ls.js:130:16)
if importing import * as SecureLS from 'secure-ls' then it throws
This package assumes that localStorage is present. In the case of NextJs Server-side Rendering, localStorage is not defined as node has no in-built support.
You should use this to have localStorage in the node. And once it is globally defined, you can use this lib: secure-ls to have additional functionalities like encrypting and compressing the data.
PS:
import*assecureLsfrom'secure-ls';
works as intended.
Please let me know if you have any further doubts.
I'm trying to use secure-ls with Angular 6 it working fine but I get the error on build log
import * as SecureLS from 'secure-ls'
The text was updated successfully, but these errors were encountered: