Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Error: An accessor cannot be declared in an ambient context #95

Closed
yatryan opened this issue May 27, 2020 · 3 comments
Closed

Error: An accessor cannot be declared in an ambient context #95

yatryan opened this issue May 27, 2020 · 3 comments

Comments

@yatryan
Copy link

yatryan commented May 27, 2020

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When building a project with a Typescript version less than 3.7, build fails with an error

ERROR in ../node_modules/@oclif/command/lib/command.d.ts:48:9 - error TS1086: An accessor cannot be declared in an ambient context.

48     get ctor(): typeof Command;
           ~~~~

error Command failed with exit code 1.

This appears to be happening since v1.6.0 (Breaking change introduced in #85). Previous version of oclif v1.5 does not have this issue (as typescript is an earlier version).

What is the expected behavior?

Build should succeed. I'm not sure if typescript can be downgraded, or at least a Breaking Change be noted in the changelog, etc.

x-post: oclif/oclif#350

@jgwhite
Copy link

jgwhite commented Jul 13, 2020

I tried to recreate this in a freshly-generated OCLIF project with TypeScript 3.6.4 but didn’t encounter the error. Could you provide more context from your project? The tsconfig.json may be useful to help us narrow down the issue. Thanks!

@yatryan
Copy link
Author

yatryan commented Jul 20, 2020

Hey @jgwhite, my tsconfig.json is the default one from a freshly-generated project. I have since tried to reproduce the bug i was having in may, with no luck. I believe my yarn/npm cache was just out of sorts. thanks!

@yatryan yatryan closed this as completed Jul 20, 2020
@jgwhite
Copy link

jgwhite commented Jul 20, 2020

@yatryan great to hear it’s working! Thanks for the response.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants