iot-app-kit icon indicating copy to clipboard operation
iot-app-kit copied to clipboard

error TS2315: Type 'Object3D' is not generic

Open gemmerton opened this issue 1 year ago • 4 comments

Unable to compile in Angular app, following errors occur on issuing 'ng serve';

Error: node_modules/@iot-app-kit/scene-composer/dist/src/store/Store.d.ts:52:61 - error TS2315: Type 'Object3D' is not generic.

52 getObject3DBySceneNodeRef: (ref: string | undefined) => import("three").Object3D<import("three").Event> | undefined; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@iot-app-kit/scene-composer/dist/src/store/Store.d.ts:59:58 - error TS2315: Type 'Object3D' is not generic.

59 setSceneNodeObject3DMapping: (ref: string, object3d: import("three").Object3D<import("three").Event>) => void; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@iot-app-kit/scene-composer/dist/src/store/Store.d.ts:115:61 - error TS2315: Type 'Object3D' is not generic.

115 getObject3DBySceneNodeRef: (ref: string | undefined) => import("three").Object3D<import("three").Event> | undefined; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@iot-app-kit/scene-composer/dist/src/store/Store.d.ts:122:58 - error TS2315: Type 'Object3D' is not generic.

122 setSceneNodeObject3DMapping: (ref: string, object3d: import("three").Object3D<import("three").Event>) => void; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@iot-app-kit/scene-composer/dist/src/three/TransformControls.d.ts:132:46 - error TS2315: Type 'Mesh' is not generic.

132 declare class TransformControlsPlane extends Mesh<PlaneGeometry, MeshBasicMaterial> { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@iot-app-kit/scene-composer/node_modules/@react-three/fiber/dist/declarations/src/three-types.d.ts:19:69 - error TS2694: Namespace '"G:/git/Public/aws-samples/aws-iot-robot/PiBot-website/node_modules/three/src/Three"' has no exported member 'ColorRepresentation'.

19 export declare type ColorArray = typeof THREE.Color | [color: THREE.ColorRepresentation]; ~~~~~~~~~~~~~~~~~~~

Error: node_modules/@iot-app-kit/scene-composer/node_modules/@react-three/fiber/dist/declarations/src/three-types.d.ts:108:69 - error TS2724: '"G:/git/Public/aws-samples/aws-iot-robot/PiBot-website/node_modules/three/src/Three"' has no exported member named 'CapsuleBufferGeometry'. Did you mean 'ShapeBufferGeometry'?

108 export declare type CapsuleGeometryProps = BufferGeometryNode<THREE.CapsuleBufferGeometry, typeof THREE.CapsuleBufferGeometry>; ~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@iot-app-kit/scene-composer/node_modules/@react-three/fiber/dist/declarations/src/three-types.d.ts:108:105 - error TS2551: Property 'CapsuleBufferGeometry' does not exist on type 'typeof import("G:/git/Public/aws-samples/aws-iot-robot/PiBot-website/node_modules/three/src/Three")'. Did you mean 'ShapeBufferGeometry'?

108 export declare type CapsuleGeometryProps = BufferGeometryNode<THREE.CapsuleBufferGeometry, typeof THREE.CapsuleBufferGeometry>;

To Reproduce Simply add the following import to the ts file for any angular component;

import { SceneViewer } from '@iot-app-kit/scene-composer';

I can add the other iot-app-kit imports without error, it is just anything related to the scene composer

Expected behavior Code should compile successfully

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information): Windows 11

Smartphone (please complete the following information): N/A

Additional context Add any other context about the problem here.

gemmerton avatar Jul 25 '23 13:07 gemmerton

Created task in TwinMaker backlog

haweston avatar Feb 01 '24 21:02 haweston

I am facing same issue. Is there any update regarding this bug?

miantalha48 avatar Feb 19 '24 08:02 miantalha48

@gemmerton How did you solve it ?

miantalha48 avatar Feb 19 '24 08:02 miantalha48

We will review the priority of this bug soon.

sheilaXu avatar Feb 19 '24 21:02 sheilaXu

Angular is not the official supported framework. Closing this issue. Feel free to file a feature request if Angular is necessary for your use case. 🙏

chejimmy avatar Jul 22 '24 20:07 chejimmy