deno_graph icon indicating copy to clipboard operation
deno_graph copied to clipboard

fix: error on conflicting assertions

Open lucacasonato opened this issue 3 years ago • 1 comments

Previously, if a specifier was imported more than once, with conflicting assertions, we'd only really consider the final import. This is wrong: conflicting assertions are an error in-themselves already. I think this behaviour is still wrong, because if a module is imported with incorrect assertions later in the graph after the module has already been loaded by an import with a correct assertion, no error will be raised.

lucacasonato avatar May 20 '22 12:05 lucacasonato

Long term we should do this with #132 instead, and associate import assertion errors with each import. With per-import errors being a third kind on top of resolution errors and module slot errors. Maybe this patches some error cases, but the data modelling wrt import assertions is still in a very bad state.

nayeemrmn avatar May 20 '22 13:05 nayeemrmn