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:
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:Node v20.15.1