I'm trying to add an API key into config.ts, but if I try to access process.env.MY_KEY, I get an error throw 'process is not defined'.
Example - config.ts:
export const SECRET_KEY = process.env.SECRET_KEY;
.env:
SECRET_KEY =thisisasecretkey
results in:
Uncaught ReferenceError: process is not defined
at ./src/config.ts (config.ts:5:31)
at webpack_require (bootstrap:19:1)
at ./src/util/handleError.ts (getReadableErrorText.ts:145:1)
at webpack_require (bootstrap:19:1)
at main.5b0c710f9735bf5a815d.js:29933:75
at main.5b0c710f9735bf5a815d.js:30013:3
at main.5b0c710f9735bf5a815d.js:30015:12
This is when running npm run dev.
Is there anything I am missing? Some sort of refresh? Caching maybe? Version update?
I'm trying to add an API key into config.ts, but if I try to access process.env.MY_KEY, I get an error throw 'process is not defined'.
Example - config.ts:
export const SECRET_KEY = process.env.SECRET_KEY;
.env:
SECRET_KEY =thisisasecretkey
results in:
Uncaught ReferenceError: process is not defined at ./src/config.ts (config.ts:5:31) at webpack_require (bootstrap:19:1) at ./src/util/handleError.ts (getReadableErrorText.ts:145:1) at webpack_require (bootstrap:19:1) at main.5b0c710f9735bf5a815d.js:29933:75 at main.5b0c710f9735bf5a815d.js:30013:3 at main.5b0c710f9735bf5a815d.js:30015:12
This is when running npm run dev.
Is there anything I am missing? Some sort of refresh? Caching maybe? Version update?