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

error TS1086: An accessor cannot be declared in an ambient context #766

Closed
tvaher opened this issue Aug 25, 2020 · 2 comments
Closed

error TS1086: An accessor cannot be declared in an ambient context #766

tvaher opened this issue Aug 25, 2020 · 2 comments

Comments

@tvaher
Copy link

tvaher commented Aug 25, 2020

Related issues

Here is quite similar problem, but solution is not suitable in this case (update to typescript 3.8.2).
#667

[REQUIRED] Version info

node:

12.6.0

firebase-functions:

3.0.0

firebase-tools:

7.0.2

firebase-admin:
8.0.0

[REQUIRED] Test case

Run command:
ng serve

Error described occurs (see log).

[REQUIRED] Steps to reproduce

I updated firebase-tools from version 7.0.2 to 8.9.0 and also typescript to version 3.8.2 and managed to upload function to firestore. Then I run ng serve and got following error:
ERROR in functions/node_modules/firebase-functions/lib/apps.d.ts(26,13): error TS1086: An accessor cannot be declared in an ambient context.

[REQUIRED] Expected behavior

At this moment I can't use newer version of typescript because Angular version and dependencies. I downgraded firebase-tools back to 7.0.2 and typescript back to 3.4.5, but error still exists, when trying to compile and serve. Is there somekind of solution for this.

[REQUIRED] Actual behavior

When running again ng -serve, error appears. Error points to functions/node_modules/ -libraries.

ERROR in functions/node_modules/firebase-functions/lib/apps.d.ts(26,13): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/apps.d.ts(33,21): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/function-builder.d.ts(64,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/function-builder.d.ts(77,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/function-builder.d.ts(111,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/function-builder.d.ts(125,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/function-builder.d.ts(132,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/function-builder.d.ts(139,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/function-builder.d.ts(148,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/function-builder.d.ts(161,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/function-builder.d.ts(170,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/function-builder.d.ts(176,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/handler-builder.d.ts(41,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/handler-builder.d.ts(76,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/handler-builder.d.ts(116,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/handler-builder.d.ts(150,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/handler-builder.d.ts(163,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/handler-builder.d.ts(176,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/handler-builder.d.ts(212,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/handler-builder.d.ts(233,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/handler-builder.d.ts(255,9): error TS1086: An accessor cannot be declared in an ambient context.
functions/node_modules/firebase-functions/lib/handler-builder.d.ts(268,9): error TS1086: An accessor cannot be declared in an ambient context.

Were you able to successfully deploy your functions?

Function was deployed successfully, but error occurs despite downgrading typescript and firebase-tools.

@google-oss-bot
Copy link
Collaborator

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

@tvaher
Copy link
Author

tvaher commented Dec 7, 2020

Only way was to update Angular, Angular dependencies, typescript and firebase-tools carefully. I'll close this issue.

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

No branches or pull requests

2 participants