chihab / dotenv-run

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

I cannot access my environment variables in my environment.ts #51

Closed FelixH15 closed 1 year ago

FelixH15 commented 1 year ago

I encountered an error while trying to build my Angular application. The specific error message is as follows: `ERROR in ./src/environments/environment.ts 6:19 Module parse failed: Unexpected token (6:19) You may need an appropriate loader to handle this file type.

baseURL: import.meta.env["BASE_URL"],

| ssoURL: import.meta.env["SSO_URL"], | chatURL: import.meta.env["CHAT_URL"],`

Here's my environment.prod.ts code: export const environment = { production: true, baseURL: import.meta.env["BASE_URL"], ssoURL: import.meta.env["SSO_URL"], chatURL: import.meta.env["CHAT_URL"], };

I'm using angular 7

Thank you

chihab commented 1 year ago

Hey could you provide a repo that reproduces the issue?

chihab commented 1 year ago

Closing the issue. Feel free to re-open the issue with a reproducing project (preferrably on stackblitz).