Deno: websocket example broken on windows

Created on 6 Apr 2020  Â·  3Comments  Â·  Source: denoland/deno

https://github.com/denoland/deno/blob/6720a0dc02dc5a93472520e6d23ca033d7ec9d88/std/examples/chat/server.ts#L49

this line have some problems in windows while running locally , error text :

error: Uncaught NotFound: The system cannot find the path specified. (os error 3)
â–º $deno$/ops/dispatch_json.ts:43:11
    at NotFound ($deno$/errors.ts:75:5)
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at sendAsync ($deno$/ops/dispatch_json.ts:98:10)

deno version : 0.39.0
windows : 10 x64

i will make a PR for this

bug

Most helpful comment

command :
deno --allow-net --allow-read server.ts

console at first step :
chat server starting on :8080....

and when localhost:8080 opend and new URL created , u.pathname will be :
/C:/Users/Ali/Desktop/deno/std/examples/chat/index.html
And it causes an error i mentioned before ,

same behavior in node for URL pathname .

All 3 comments

Hey @disizali, can you send steps to reproduce this error?

command :
deno --allow-net --allow-read server.ts

console at first step :
chat server starting on :8080....

and when localhost:8080 opend and new URL created , u.pathname will be :
/C:/Users/Ali/Desktop/deno/std/examples/chat/index.html
And it causes an error i mentioned before ,

same behavior in node for URL pathname .

I've met similar situation on windows CI too many times. Path based on import.meta.url doesn't work windows. I'm not familiar with windows file system, /C:/Users/Ali/Desktop/deno/std/examples/chat/index.html is valid path for system?

This path is constructed based on import.meta.url(/C:/Users/Ali/Desktop/deno/std/examples/chat/server.ts) . Is also valid?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

metakeule picture metakeule  Â·  3Comments

ry picture ry  Â·  3Comments

benjamingr picture benjamingr  Â·  3Comments

kyeotic picture kyeotic  Â·  3Comments

davidbarratt picture davidbarratt  Â·  3Comments