Ajaxy / telegram-tt

Telegram Web A, GPL v3
https://web.telegram.org/a
GNU General Public License v3.0
2.33k stars 495 forks source link

Uncaught ReferenceError: process is not defined error when trying to add configs #238

Closed elitGithub closed 1 year ago

elitGithub commented 1 year ago

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?