Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loading the library in angular 7 has the error "An accessor cannot be declared in an ambient context." #55

Closed
helxsz opened this issue Jan 11, 2020 · 2 comments

Comments

@helxsz
Copy link

helxsz commented Jan 11, 2020

i am using angular 7 with three-loader,

simply loading the library using the code 'import { PointCloudOctree, Potree } from '@pnext/three-loader';' gives me some errors

ERROR in node_modules/@pnext/three-loader/build/declarations/materials/point-cloud-material.d.ts(152,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/materials/point-cloud-material.d.ts(153,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/materials/point-cloud-material.d.ts(154,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/materials/point-cloud-material.d.ts(155,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/materials/point-cloud-material.d.ts(157,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/materials/point-cloud-material.d.ts(158,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree-node.d.ts(17,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree-node.d.ts(18,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree-node.d.ts(19,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree-node.d.ts(20,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree-node.d.ts(21,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree-node.d.ts(22,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree-node.d.ts(23,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree-node.d.ts(24,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree-node.d.ts(25,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree.d.ts(53,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree.d.ts(54,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/point-cloud-octree.d.ts(77,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/potree.d.ts(26,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/potree.d.ts(27,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@pnext/three-loader/build/declarations/utils/lru.d.ts(19,9): error TS1086: An accessor cannot be declared in an ambient context.
@rhuitl
Copy link
Contributor

rhuitl commented Jan 12, 2020

This is because typings files generated with TypeScript 3.7 are not backward compatible. Both Three.JS and three-loader have updated to 3.7. Update the TS version you use to 3.7+ and it will work.

However, there is a catch: the Angular compiler does not yet support this version. Support for it is scheduled for Angular 9.1, but there is a workaround, see angular/angular-cli#16071.

@helxsz
Copy link
Author

helxsz commented Jan 14, 2020

thanks, i got it

@helxsz helxsz closed this as completed Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants