Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The global variable in Zone.js not compatible with the one in @types/node #37531

Closed
JasonHK opened this issue Jun 11, 2020 · 13 comments 路 Fixed by kubikowski/inanity#26
Closed
Assignees
Milestone

Comments

@JasonHK
Copy link

JasonHK commented Jun 11, 2020

馃悶 bug report

Affected Package

he issue is caused by package zone.js

Is this a regression?

No.

Description

In DefinitelyTyped/DefinitelyTyped#44700, the type definition of the global variable was updated to NodeJS.Global & typeof globalThis. Which makes the Zone.js package not compatible with @types/node 14.0.5 or up.

This issue was reported in DefinitelyTyped/DefinitelyTyped#45116.

馃敩 Minimal Reproduction

馃敟 Exception or Error





馃實 Your Environment

Angular Version:





Anything else relevant?

@ngbot ngbot bot added this to the needsTriage milestone Jun 11, 2020
@JiaLiPassion JiaLiPassion self-assigned this Jun 27, 2020
JiaLiPassion added a commit to JiaLiPassion/angular that referenced this issue Jun 30, 2020
Close angular#37531

Remove `global` declaration in zone.ts to avoid compile error when
upgrade to `@types/node`.
JiaLiPassion added a commit to JiaLiPassion/angular that referenced this issue Jul 1, 2020
Close angular#37531

Remove `global` declaration in `zone.ts` to avoid compile error when
upgrade to `@types/node` v14.0.5. Since the new type of global become
`Global` and not compatible with `zone.ts` declaration.
@tachojelev
Copy link

Hello guys, is there any update on this, I can see a PR is opened. Can we expect this to be fixed and released any time soon?

@darkoandreev
Copy link

Hello guys, any update on this? I have exactly the same problem.

@chiefmc
Copy link

chiefmc commented Jul 20, 2020

I'll subscribe to the thread

@JiaLiPassion
Copy link
Contributor

Now the new version is under review, so please wait for some more days, thanks.

JiaLiPassion added a commit to JiaLiPassion/angular that referenced this issue Jul 24, 2020
Close angular#37531

Remove `global` declaration in `zone.ts` to avoid compile error when
upgrade to `@types/node` v14.0.5. Since the new type of global become
`Global` and not compatible with `zone.ts` declaration.
JiaLiPassion added a commit to JiaLiPassion/angular that referenced this issue Jul 30, 2020
Close angular#37531

Remove `global` declaration in `zone.ts` to avoid compile error when
upgrade to `@types/node` v14.0.5. Since the new type of global become
`Global` and not compatible with `zone.ts` declaration.
JiaLiPassion added a commit to JiaLiPassion/angular that referenced this issue Jul 30, 2020
Close angular#37531

Remove `global` declaration in `zone.ts` to avoid compile error when
upgrade to `@types/node` v14.0.5. Since the new type of global become
`Global` and not compatible with `zone.ts` declaration.
@centigrade-julian-lang
Copy link

Any news on this one? :)

@chekit
Copy link

chekit commented Aug 27, 2020

In my case adding "es2018" to tsconfig.base.json libs section helped

@rezonant
Copy link

@chekit Careful, Zone.js does not work correctly with native async/await (which would be enabled if you build with ES2017 and above) #31730

@chekit
Copy link

chekit commented Aug 29, 2020

@chekit Careful, Zone.js does not work correctly with native async/await (which would be enabled if you build with ES2017 and above) #31730

Nice point, thank you. I鈥檒l double check 馃憤

JiaLiPassion added a commit to JiaLiPassion/angular that referenced this issue Aug 30, 2020
Close angular#37531

Remove `global` declaration in `zone.ts` to avoid compile error when
upgrade to `@types/node` v14.0.5. Since the new type of global become
`Global` and not compatible with `zone.ts` declaration.
@JiaLiPassion
Copy link
Contributor

This issue need to be resolved after updating the @types/node to the new version.
BTW, I used @types/node 14.6.2 and it seems there is no compile error, I am not sure I am using the correct way to reproduce the issue.

@Zeetah
Copy link

Zeetah commented Sep 17, 2020

This affects also for example node 12.12.61. So i guess you should not make it only compliant with v14. We have had to skip already several version updates to the @types/node 12 line from 21 May onwards.

So is there a way we could fix this soon(ish) @JiaLiPassion?

@JiaLiPassion
Copy link
Contributor

@Zeetah, I don't think this can be resolved easily unless Angular CLI update @types/node for Angular apps to 12.12.61+, for now, you have to use the older version of @types/node.

@danlz
Copy link

danlz commented Sep 25, 2020

Upgrading zone.js to 0.11.1 helps.

JiaLiPassion added a commit to JiaLiPassion/angular that referenced this issue Oct 18, 2020
Close angular#37531

Remove `global` declaration in `zone.ts` to avoid compile error when
upgrade to `@types/node` v12.12.68. Since the new type of global become
`NodeJS.global & typeof globalThis` and not compatible with `zone.ts` declaration.
@alxhub alxhub closed this as completed in 90c0772 Oct 23, 2020
alxhub pushed a commit that referenced this issue Oct 23, 2020
Close #37531

Remove `global` declaration in `zone.ts` to avoid compile error when
upgrade to `@types/node` v12.12.68. Since the new type of global become
`NodeJS.global & typeof globalThis` and not compatible with `zone.ts` declaration.

PR Close #37861
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.