Bug: Incorrect module resolution for "valid" ES2015 specifiers with hashes and/or search parameters #22689
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Domain: ES Modules
The issue relates to import/export style module behavior
Suggestion
An idea for TypeScript
TypeScript Version: 2.8.0-dev.20180315
Search Terms: moduleResolution "module path" hash
Code
Expected behavior:
Since module specifiers are now standardized, whereby if given an absolute specifier (or a relative specifier and the absolute referrer) should always result in a validly constructed
new URL(specifier, referrer)
it is expected that when a specifier includes suffix aspects like hash and search, that those aspects would be excluded from the pathname that is being resolved.The implications of hash and search in runtime is beyond the scope of TypeScript and should remain so unless somehow the environment is customized to behave different (plugins maybe). However, if at all relevant, the specs have stated that at runtime each unique "resolved" URL (including hash and search) evaluates to a single unique instance of the respective module. It is not expected that TypeScript would need to determine if and when a module is a specific unique instance. It is however expected that when suffix aspects are included in the specifier that TypeScript would still resolve it's types identically as it does for the pathname sans hash and search.
Sorry for the long text!
Actual behavior:
TypeScript does not resolve pathnames with hash or search parameters.
The text was updated successfully, but these errors were encountered: