-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflict with block-scoped @types/node
on env.d.ts
#8
Comments
Maybe it'll be useful for some people. I was able to resolve the issue by using TS' merge declaration. Although be aware as it won't fail in case there is no such property in your env file. // <project_root>/env.d.ts
declare namespace NodeJS {
/** Merge declaration with `process` in order to override the global-scoped env. */
export interface ProcessEnv {
/**
* Built-in environment variable.
* @see Docs https://github.com/chihab/ngx-env#ng_app_env.
*/
readonly NG_APP_ENV: string;
// Add your environment variables below
/** Test data. */
readonly NG_APP_TITLE: string;
}
} |
Shouldn't the definition file below do it?
Is the re-declaration error message only on VSCode or do you also get it on the command line (ng serve)? |
The re-declaration is only on my IDE since the declaration file is not included in any of the applications in multiworkspace (by default). Anyway, your solution works great, thanks @chihab! |
Hi I have the same problem but I didn't understand the fix. I have
and when I run my linter: tsc --noEmit && eslint . --ext js,ts --quiet --fix "Cannot redeclare block-scoped variable 'process'." |
Hi guys, thanks for your work! I was wondering how do you resolve the issue with overriding node-provided
process
? Also, the type definition is not checked by the compiler (since the file is not incuded into thefiles
section oftsconfig.app.json
for multiproject structure), is it intended only to be used by the IDE's autocomplete?Environment:
![image](https://user-images.githubusercontent.com/37013688/142836172-1aa27295-4384-4688-929a-76ddfc0d7b74.png)
Angular v13.0.0
@ngx-env/builder 2.0.0
Thanks!
The text was updated successfully, but these errors were encountered: