Skip to content

Type Error #51

@HakanSungur

Description

@HakanSungur

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions