sushinpv / react-secure-storage

This is a wrapper written above local storage to write the data securely to local storage
https://npmjs.com/package/react-secure-storage
MIT License
126 stars 12 forks source link

Uncaught ReferenceError: process is not defined at getFingerprint2 #5

Closed tboy44wiz closed 1 year ago

tboy44wiz commented 1 year ago

I installed this package in My React App and also set my SECURE_LOCAL_STORAGE_HASH_KEY in my .env file but once I call the "import" line, I get the error below. Please any solution to this. I even downgraded to version 1.0.18 still the error persisted. I used Vite to create the React App.

Uncaught ReferenceError: process is not defined at getFingerprint2 (fingerprint.js:23:8) at new EncryptionService2 (encryption.js:33:39) at getAllLocalStorageItems2 (localStorageHelpers.js:32:19) at new SecureLocalStorage2 (index.js:57:56) at node_modules/react-secure-storage/dist/index.js (index.js:117:26) at __require2 (chunk-BHN6OJC3.js?v=c31a19ab:15:50) at index.js:119:19

sushinpv commented 1 year ago

Hi @tboy44wiz Can you please provide the Node, NPM and react version which you are using and the command you have run to create the app,

tboy44wiz commented 1 year ago

Hi @tboy44wiz Can you please provide the Node, NPM and react version which you are using and the command you have run to create the app,

npm version = 8.15.0 node version = 16.17.0

tboy44wiz commented 1 year ago

Do you mind if I contribute to the fixing?

sushinpv commented 1 year ago

@tboy44wiz You can contribute, and I got engaged with few other work, it might take same time for me to take a look

Please make sure to create a new branch called dev/*** and create a PR, also before creating the PR just run yarn build:lib or npm run build:lib to build the files

sushinpv commented 1 year ago

@tboy44wiz Can you please provide your react-scripts version and if you are using webpack, then webpack version too?

To solve the "Uncaught ReferenceError: process is not defined" in React, open your terminal in your project's root directory and update the version of your react-scripts package by running npm install react-scripts@latest and re-install your dependencies if necessary.

https://bobbyhadz.com/blog/react-referenceerror-process-not-defined