Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vendor): handle relative imports when mapped local folder name differs from remote's #14465

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented May 2, 2022

I was using deno vendor this weekend and found this bug.

// https://localhost/npm:test/file.js
export function test() {}

// https://localhost/npm:other/file.js
import "../npm:test/file.js";

In this case, the npm:x folders will be mapped to npm_x. So when ../npm:test/file.js?test is resolved it can't find the folder because it's looking for ../npm_test. See the tests for more details.

Maybe this is an import map bug though and shouldn't be fixed in deno vendor? Also, perhaps there is a better way than this fix?

@dsherret dsherret requested a review from bartlomieju as a code owner May 2, 2022 17:04
@dsherret dsherret changed the title fix(vendor): handle relative imports when mapped local folder name differs from server's fix(vendor): handle relative imports when mapped local folder name differs from remote's May 2, 2022
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dsherret dsherret merged commit d93b762 into denoland:main May 23, 2022
@dsherret dsherret deleted the fix_vendor_relative_import_different_local_folder_name branch May 23, 2022 16:49
kitsonk pushed a commit that referenced this pull request May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants