Opentelemetry-js: Fresh install doesn't work anymore

Created on 25 May 2020  ยท  8Comments  ยท  Source: open-telemetry/opentelemetry-js

node_modules/@types/node/ts3.4/globals.global.d.ts:1:13 - error TS2403: Subsequent variable declarations must have the same type. Variable 'global' must be of type 'Global', but here has type 'Global & typeof globalThis'.

1 declare var global: NodeJS.Global & typeof globalThis;

Not sure how this passed on circleCI ?

bug

Most helpful comment

Hi,
I had the same trouble with an Angular project,
when installing a fresh version (from start / CI context).
Just downgrade @types/node from 12.12.42 to 12.12.35 and now it works
Let me know if something gets fixed
Hope it helps !

All 8 comments

It does work on my fresh install. I noticed there is a ts3.4 in your log. Does that mean in your case typescript 3.4 is used instead of what version constraint ^3.7.2 specified in package.json?

it would not make sense at all, fresh install is fresh install, it should work fine. Did you checkout the latest to a new place and then tried to npm i ?

Hi,
I had the same trouble with an Angular project,
when installing a fresh version (from start / CI context).
Just downgrade @types/node from 12.12.42 to 12.12.35 and now it works
Let me know if something gets fixed
Hope it helps !

Thanks @yanzacheus that is very helpful. I was just working on this locally and it was very frustrating. What made you decide on that exact version? Is there some open issue you're aware of, or was it just trial and error?

I saw similar in opentelemetry-js-contrib/plugins/web/opentelemetry-plugin-user-interaction and the downgrade of @types/node proposed by @yanzacheus also helped.

I found the root of this error. The version we were using of @types/webpack-env collided with the latest version of @types/node. The same issue is apparently affecting zone.js right now which blocks compilation of the latest zone scope peer dep on the latest @types/node. Even removing @types/node from the zone scope peer dep package.json does not fix it because lerna has a deep dependency issue which causes @types/node to be installed in the global node_modules. I have created a PR https://github.com/lerna/lerna/pull/2603 against lerna to remedy this issue.

Thanks @yanzacheus that is very helpful. I was just working on this locally and it was very frustrating. What made you decide on that exact version? Is there some open issue you're aware of, or was it just trial and error?

Hello
no I did'nt try to find the exact version from which it fails.
I just picked up the last version that worked for my project from my local package-lock.json
Then I set this exact version in my package.json "12.12.35" :(
then I checked how @types/node was used with npm ls @types/node:
[email protected] /home/tofino/workspace/gitlab/mikado/mcy-web/mikado-web/web
โ”œโ”€โ”ฌ @angular-devkit/[email protected]
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ””โ”€โ”ฌ @types/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @types/[email protected] deduped
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @types/[email protected] deduped
โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”ฌ @types/[email protected]
โ”‚ โ””โ”€โ”€ @types/[email protected] deduped
โ””โ”€โ”€ @types/[email protected]

version 12.12.35 was used everywhere, so it was enough for me

We found a workaround which should have fixed this issue. If the issue persists, feel free to reopen this.

Was this page helpful?
0 / 5 - 0 ratings