Skip to content

Cant run compiled demo file (default server example): "run again with --allow-net", but I'm actually using the flag. #9970

@ibnz36

Description

@ibnz36

Hi. I was trying demo by the first time, and I already have some issues.
I really like the fact that demo can be compiled, so, I tried compiling the default server example.

Here's my code, the command and the error:

demo-test.ts

import { serve } from "https://deno.land/std@0.92.0/http/server.ts";
const server = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of server) {
  req.respond({ body: "Hello World\n" });
}

I compiled using demo compile --unstable demo-test.ts --allow-net,
And runned the executable using ./deno.test --allow-net

It gives me this error:

error: PermissionDenied: Requires net access to "0.0.0.0:8000", run again with the --allow-net flag

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions