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

Problem with karma typescript #1426

Closed
xgrommx opened this issue Dec 16, 2020 · 4 comments
Closed

Problem with karma typescript #1426

xgrommx opened this issue Dec 16, 2020 · 4 comments

Comments

@xgrommx
Copy link

xgrommx commented Dec 16, 2020

Hello everyone. After update to 3 version I got several errors

node_modules/socket.io-client/build/socket.d.ts(38,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/socket.io-client/build/socket.d.ts(168,9): error TS1086: An accessor cannot be declared in an ambient context.

How can I fix it?

@darrachequesne
Copy link
Member

Hi! Which version of typescript are you using? I can't reproduce with the example here: https://github.com/socketio/socket.io/tree/master/examples/typescript

(tested with typescript 4.0.5 and 3.6.5)

@MaximeMnt
Copy link

MaximeMnt commented Jan 14, 2021

Same issue here @darrachequesne , i'm building an Angular app. I'm using the latest version of typescript: typescript@4.1.3

Angular CLI: 10.1.7
Node: 12.19.0
OS: win32 x64

Angular:
...
Ivy Workspace:

Package Version

@angular-devkit/architect 0.1001.7 (cli-only)
@angular-devkit/core 10.1.7 (cli-only)
@angular-devkit/schematics 10.1.7 (cli-only)
@schematics/angular 10.1.7 (cli-only)
@schematics/update 0.1001.7 (cli-only)

Error:

ERROR in node_modules/socket.io-client/build/socket.d.ts:39:9 - error TS1086: An accessor cannot be declared in an ambient context.

39     get active(): boolean;
           ~~~~~~
node_modules/socket.io-client/build/socket.d.ts:176:9 - error TS1086: An accessor cannot be declared in an ambient context.

176     get volatile(): Socket;
            ~~~~~~~~

@MaximeMnt
Copy link

MaximeMnt commented Jan 14, 2021

I found a possible solution, Adding this line into the tsconfig.json file fixed the error!

"compilerOptions": {
    "skipLibCheck": true
}

@darrachequesne
Copy link
Member

It seems to be linked to the issue here: microsoft/TypeScript#33939

I'm not sure if we can do something about it though...

@xgrommx xgrommx closed this as completed Jan 15, 2021
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

3 participants