oven-sh/bun
GitHub で見るMisleading error message "URL must not be a blank string" when URL is a non-string value which does not stringify to a fully valid URL with a hostname
Open
#21,361 opened on 2025年7月24日
bugconfirmed buggood first issueweb:fetch
説明
What version of Bun is running?
1.2.18+0d4089ea7
What platform is your computer?
Darwin 24.3.0 arm64 arm
What steps can reproduce the bug?
Any of the following (and more):
await fetch(undefined)
await fetch(123)
await fetch({toString() {return `/some_path`}})
What is the expected behavior?
Something more precise, like:
fetch() URL must have a hostname
What do you see instead?
fetch() URL must not be a blank string
Additional information
Link to offending line in Bun sources: https://github.com/oven-sh/bun/blob/bd232189b4c39ac3c8ccef9cf0932407d65c527a/src/bun.js/webcore/fetch.zig#L1448