New module import error => "ReferenceError: self is not defined"

Viewed 1276
import { EncryptStorage } from 'encrypt-storage';

export const encryptStorage = EncryptStorage('secret_key');

encryptStorage.setItem('user', userObj);

error :

enter image description here

I am trying to encrypt the localstorage using encrypt-storage but the import is giving me error and project crashed after putting only 3 line of code.

Dynamic import of next is not working as most of the solution i found is for component not for package.

This solution is not working for dynamic module import as i am getting some assignment error in loader.

Thanks in advance. :)

0 Answers
Related