Type Error
I'm using React 18 under the Remix Framework and configuring it with Vite. My necessary keys are written in the .env file. I am importing secureLocalStorage like this:
import secureLocalStorage from "react-secure-storage";
I am using it like this:
const userId = secureLocalStorage.getItem("userId");
I'm encountering this error: TypeError: vite_ssr_import_2.default.getItem is not a function. I would appreciate your help. Also, in my Vite configuration, the following exists:
"process.env": {},
global: {},
}
Node v20.15.1
I'm using React 18 under the Remix Framework and configuring it with Vite. My necessary keys are written in the .env file. I am importing secureLocalStorage like this:
import secureLocalStorage from "react-secure-storage";I am using it like this:const userId = secureLocalStorage.getItem("userId");I'm encountering this error: TypeError: vite_ssr_import_2.default.getItem is not a function. I would appreciate your help. Also, in my Vite configuration, the following exists:"process.env": {}, global: {}, }Node v20.15.1
Did you found a workaround or solution?