chihab / dotenv-run

Seamlessly load environment variables. Supports cli, esbuild, rollup, vite, webpack, angular. ESM and Monorepos.
246 stars 17 forks source link

ERROR ReferenceError: process is not defined #17

Closed bavaleakashGL closed 2 years ago

bavaleakashGL commented 2 years ago

I always end up with this error core.mjs:6485 ERROR ReferenceError: process is not defined I am using Angular 13

chihab commented 2 years ago

Did you run the command ng add @ngx-env/builder? Could you copy/paste your angular.json here?

chihab commented 2 years ago

Closing it. Feel free to re-open the issue if you encounter it again.

bavaleakashGL commented 2 years ago

This is how I resolved it: By default Angular does not allow process variable, you will need to add

*import as process from 'process'; window['process'] = process;**

in polyfills.ts in order to enable it, after this it was a piece of cake. Thanks.