Skip to main content

phase_duplicate_bindings

Function phase_duplicate_bindings 

Source
pub fn phase_duplicate_bindings(
    parsed: &[ParsedFile],
    groups: &BTreeMap<String, Vec<usize>>,
    bindings: &BTreeMap<String, Vec<WorkerBinding>>,
    errors: &mut ErrorSink,
)
Expand description

bynk.context.duplicate_binding: each context’s Worker declares every binding name once. bindings holds each context’s bindings as its wrangler.toml would list them. One error per clash, at the declaration that brought in the second binding (an agent, or a consumes clause), preferring one the author wrote over consumes bynk.cloudflare, naming both sources. A clash between two sources with no declaration of their own (Service Bindings added for event subscribers) is reported at the context’s name.