You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I am trying to implement dxf-viewer to my project on Angular 16. But I have error when building my project Cannot find namespace 'THREE'. All i did is installed packages dxf-viewer and three.js, added imports to component and run project with ng serve command, after that received several errors like this:
It seems that the problem is that src/index.d.ts does not import three.js. It worked for me, but probably it depends on bundler/compiler. I am not really aware, if TS types declaration file should import something.
Hello. I cloned package and added it to my project in root level of src folder src/dxf-viewer, after this added import * as THREE from 'three'; to dxf-viewer/src/index.d.ts file. In my component I import lib as always import { DxfViewer } from "src/dxf-viewer";but with path to my copy, not to node_modules. It seems to work for now, but if add worker like in example it still has same error for other declarations for DOM elements and other. May be if to make a build and add it to project, will be no errors, but in this case, all typing will be lost.
Hello. I am trying to implement dxf-viewer to my project on Angular 16. But I have error when building my project Cannot find namespace 'THREE'. All i did is installed packages dxf-viewer and three.js, added imports to component and run project with ng serve command, after that received several errors like this:
Error: node_modules/dxf-viewer/src/index.d.ts:21:17 - error TS2503: Cannot find namespace 'THREE'. 21 clearColor: THREE.Color,
My imports:
import * as THREE from 'three'; import { DxfViewer } from "dxf-viewer";
This is stackblitz example with same errors.
How to fix this error?
The text was updated successfully, but these errors were encountered: