I am facing an issue with adding Three JS to my Angular 7 project. Despite installing npm install three --save
and its type npm install @type/webgl2
, I encountered an error after importing it into my component controller. The import statement used was import * as THREE from 'three';
. Following a guide on Stackblitz helped somewhat, but I am still getting errors that prevent me from building the project. Here is the specific error message:
ERROR in node_modules/three/src/core/BufferAttribute.d.ts(21,6): error
TS1086: An accessor cannot be declared in an ambient context.
node_modules/three/src/core/InterleavedBufferAttribute.d.ts(19,6): error
TS1086: An accessor cannot be declared in an ambient context.
node_modules/three/src/core/InterleavedBufferAttribute.d.ts(20,6): error
TS1086: An accessor cannot be declared in an ambient context.