Skip to content

ConnectionRefused when fetch() is localhost #1425

Closed

Description

What version of Bun is running?

0.2.2

What platform is your computer?

Darwin 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 20:57:23 PDT 2022; root:xnu-8020.121.3~2/RELEASE_ARM64_T8110 arm64 arm

What steps can reproduce the bug?

export default {
  port: 4281,
  fetch(request) {
    return new Response("Ok");
  }
}

console.log(await fetch("http://localhost:4281/hello"))

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

The above code fails with the error:

ConnectionRefused: fetch() failed
 path: "http://localhost:4281/hello"

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions