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

An accessor cannot be declared in an ambient context. #70

Closed
flashpuller opened this issue Jan 16, 2020 · 4 comments
Closed

An accessor cannot be declared in an ambient context. #70

flashpuller opened this issue Jan 16, 2020 · 4 comments

Comments

@flashpuller
Copy link

Error in Angular 8 project using Angular CLI. (Note it still supporting typescript<3.6.0):

ERROR in node_modules/camera-controls/dist/CameraControls.d.ts:6:16 - error TS1086: An accessor cannot be declared in an ambient context.

6 static get ACTION(): Readonly;
~~~~~~
node_modules/camera-controls/dist/CameraControls.d.ts:50:9 - error TS1086: An accessor cannot be declared in an ambient context.

50 set phiSpeed(speed: number);
~~~~~~~~
node_modules/camera-controls/dist/CameraControls.d.ts:51:9 - error TS1086: An accessor cannot be declared in an ambient context.

51 set thetaSpeed(speed: number);
~~~~~~~~~~
node_modules/camera-controls/dist/CameraControls.d.ts:52:9 - error TS1086: An accessor cannot be declared in an ambient context.

52 get boundaryEnclosesCamera(): boolean;
~~~~~~~~~~~~~~~~~~~~~~
node_modules/camera-controls/dist/CameraControls.d.ts:53:9 - error TS1086: An accessor cannot be declared in an ambient context.

53 set boundaryEnclosesCamera(boundaryEnclosesCamera: boolean);
~~~~~~~~~~~~~~~~~~~~~~

@yomotsu
Copy link
Owner

yomotsu commented Jan 16, 2020

Not sure but maybe because of the version of TS.
The d.ts is created with TS3.7. TS3.7 supports new syntax in d.ts like microsoft/TypeScript#32787

Could you try with 3.7 in your project?

Or should I just use 3.6 or so?

@omararturo
Copy link

omararturo commented Jan 16, 2020

Temporal solution:

Edit tsconfig.json:

{
    "compilerOptions": {
        "skipLibCheck": true,
        ...
    },
    ...
}

@yomotsu
Copy link
Owner

yomotsu commented Jan 17, 2020

Sorry for the inconvenience.
I'll downgrade to TS 3.0.x. Then, the error should be removed, since getter/setter in d.ts has been added at TS 3.7.0.

Sounds good?

@yomotsu
Copy link
Owner

yomotsu commented Jan 18, 2020

The problem should be solved with camera-controls v1.18.2.

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

3 participants