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

Exported parameter ValueCheckingMode has or is using private name ('Anonymous class'). #1

Closed
musicEnfanthen opened this issue Dec 12, 2016 · 4 comments

Comments

@musicEnfanthen
Copy link

musicEnfanthen commented Dec 12, 2016

On Windows 7, 64-bit (using Node v6.9.0, FF, angular2 v2.23, angular-cli v1.0.0-beta.22-1, typescript v~2.0.3) I get the error message

Exported parameter ValueCheckingMode has or is using private name ('Anonymous class').

when trying to ng serve a project using json2typescript package. Tried it with SALSAH (using json2typescript v0.9.3) and a completely new TestApplication as described in the README here (with latest v0.9.5).

Changing

public static ValueCheckingMode = class {

to

public static ValueCheckingMode: any = class {

did the trick, but I'm not sure whether it is the best possible type nor solution. It's somehow connected to this old TypeScript issue.

On MacOS X (also Node v6.9.0., FF) I could not reproduce this error, it's running without problems.

@andreas-aeschlimann
Copy link
Member

Have you tried upgrading TypeScript? It seems like this issue is resolved in later versions.

Tested with:
angular-cli 1.0.0-beta.25.5
typescript 2.1.4
json2typescript 0.9.5

Make sure you upgrade angular-cli, because there were issues with TypeScript 2.1.x and earlier angular-cli versions.

@musicEnfanthen
Copy link
Author

Sorry for the late reply, I had to wait upgrading typescript or angular-cli for several reasons. And thanks for the hint, with angular-cli 1.0.0-beta.30.0 I don't get the error anymore.

@andreas-aeschlimann
Copy link
Member

No worries, thanks for the feedback.

@trusktr
Copy link

trusktr commented Dec 21, 2019

I've opened a request to fix issues like these in TypeScript by bringing declaration files to parity with language features. microsoft/TypeScript#35822

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