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

TS2322 [ERROR]: Type '"unix"' is not assignable to type '"tcp" | undefined'. #5801

Closed
teleclimber opened this issue May 23, 2020 · 3 comments

Comments

@teleclimber
Copy link

If I run this simple script:

async function run() {
        await Deno.connect({path: "blah", transport:"unix"});
}
run();

I get this TS compilation error:

error: TS2322 [ERROR]: Type '"unix"' is not assignable to type '"tcp" | undefined'.
 await Deno.connect({path: "blah", transport:"unix"});

Yet my code is a copy of the example in docs: https://doc.deno.land/https/github.com/denoland/deno/releases/latest/download/lib.deno.d.ts#Deno.connect

I get a similar result when doing Deno.listen with same parameters (although listen docs don't even mention possibility of unix transport).

If I add //@ts-ignore my code compiles and runs fine.

Thanks.

@SyrupThinker
Copy link
Contributor

Deno.connect with the unix transport is considered unstable, you shouldn't be able to access it without the --unstable flag.

@teleclimber
Copy link
Author

OK, good to know, thanks. Perhaps the docs should indicate this?

@ry
Copy link
Member

ry commented May 24, 2020

@teleclimber Indeed the docs should indicate this. Thanks for the report - it helps.

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