Client side error: .env has no default export
cloudkompute opened this issue · comments
When I run npm start at the client side, I get this error:
ERROR in environments/environment.ts:6:8 - error TS1192: Module '"/home/Project/tp/client/src/environments/.env"' has no default export.
6 import env from './.env';
~~~
environments/environment.prod.ts:2:8 - error TS1192: Module '"/home/Project/tp/client/src/environments/.env"' has no default export.
2 import env from './.env';
~~~
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
ℹ 「wdm」: Failed to compile.
But the contents of the .env file seem to be correct:
export const env: { [s: string]: (string | null); } = { 'npm_package_version': '1.0.0' };
Fixed with PR #33
cc: @coooolers
I did following and it worked for me.
import {env} from './.env';
Thanks