Tsc error 2440 when using three 108 (UV Generator and ShaderMaterialParameters)

I just imported a library from a colleague that he uploaded to https://github.com/cmelange/ECL-3D-Components. However I am running into 2 errors.

The only thing I did was pull his repository to my pc and run npm install and npm run build. The latter resulting in this error. Does anyone have any idea why this is happening?

node_modules/three/src/geometries/ExtrudeGeometry.d.ts:2:10 - error TS2440: Import declaration conflicts with local declaration of 'UVGenerator'.
import { UVGenerator } from './ExtrudeGeometry';

node_modules/three/src/materials/ShaderMaterial.d.ts:1:10 - error TS2440: Import declaration conflicts with local declaration of 'ShaderMaterialParameters'.
import { ShaderMaterialParameters } from './ShaderMaterial';

Edit: Seems the author (sitting behind me) is on a linux machine and there it works…

I have yet to find the reason for this. I don’t know if I broke anything by removing these imports, but that seemed to have fixed it…

This error means stuff like this is not allowed:

import { MyClass } from './MyClass';

export class MyClass = MyClass;

AFAIK, this code style is not used in the three.js repository to it’s probably an issue in your project.

Weird, you say its not being used. But that code is in the node module, not my project code. Could be that it might still be used there?

Sorry, I don’t know. I’ve googled this issue a bit and I’ve only found the recommendation to avoid the above code style.

I’m getting the same issue with Angular 9:

ERROR in node_modules/three/src/materials/ShaderMaterial.d.ts:1:10 - error TS2440: Import declaration conflicts with local declaration of ‘ShaderMaterialParameters’.
1 import { ShaderMaterialParameters } from ‘./ShaderMaterial’;
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/three/src/geometries/ExtrudeGeometry.d.ts:2:10 - error TS2440: Import declaration conflicts with local declaration of ‘UVGenerator’.
2 import { UVGenerator } from ‘./ExtrudeGeometry’;

I can get around the error if I step down to Typescript 3.6 but then the app doesn’t run. 3.7.5 is needed to run Angular 9.

“dependencies”: {
@angular/animations”: “^9.0.2”,
@angular/cdk”: “^9.1.0”,
@angular/common”: “^9.0.2”,
@angular/compiler”: “^9.0.2”,
@angular/core”: “^9.0.2”,
@angular/forms”: “^9.0.2”,
@angular/material”: “^9.1.0”,
@angular/platform-browser”: “^9.0.2”,
@angular/platform-browser-dynamic”: “^9.0.2”,
@angular/router”: “^9.0.2”,
@types/node”: “^12.12.28”,
“babel”: “^6.23.0”,=
“core-js”: “^3.6.4”,
“install”: “^0.13.0”,
“primeicons”: “^2.0.0”,
“primeng”: “^9.0.0-rc.4”,
“rxjs”: “~6.5.4”,
“three”: “^0.108.0”,
“tslib”: “^1.11.0”,
“zone.js”: “~0.10.2”,
“typescript”: “~3.7.5”
}

Please try it with a newer version of three.js. This should be fixed since R110.