You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// i installed dotenv in minting dap
//created .env file in minting-dapp folder
// in .env file ALCHEMY_GEORLI_API_KEY=randomkey
//then imported as shown
//in Dapp.tsx file
import * as dotenv from '../../../../minting-dapp/node_modules/dotenv';
dotenv.config();
//for the purpose of testing
console.log(process.env.ALCHEMY_GEORLI_API_KEY)
i get error “Module build failed: Module not found:
"./node_modules/dotenv/lib/main.js" contains a reference to the file "fs".
This file can not be found, please check it for typos or update it if the file got moved.”
other things i tried:
not installing dotenv in minting-dapp insted just use directly the variable from the existing .env file in smart-contract folder, but i get “undefined” value
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
// i installed dotenv in minting dap
//created .env file in minting-dapp folder
// in .env file ALCHEMY_GEORLI_API_KEY=randomkey
//then imported as shown
//in Dapp.tsx file
import * as dotenv from '../../../../minting-dapp/node_modules/dotenv';
dotenv.config();
//for the purpose of testing
console.log(process.env.ALCHEMY_GEORLI_API_KEY)
i get error “Module build failed: Module not found:
"./node_modules/dotenv/lib/main.js" contains a reference to the file "fs".
This file can not be found, please check it for typos or update it if the file got moved.”
other things i tried:
any thoughts is appreciated, thanks
Beta Was this translation helpful? Give feedback.
All reactions