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: normalize away base in imported URLs #5065

Merged
merged 2 commits into from
Sep 24, 2021

Conversation

fwouts
Copy link
Contributor

@fwouts fwouts commented Sep 24, 2021

Description

This fixes hot-reloading issues reported in #5063.

This code was removed in https://github.com/vitejs/vite/pull/5037/files, presumably by accident, but perhaps on purpose.

Additional context

I'm not familiar enough with importAnalysis to figure out whether this is also needed for staticImportedUrls.

I'm also not sure how to test this, so someone else feel free to take over :)


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

This fixes hot-reloading issues reported in vitejs#5063.
@patak-dev
Copy link
Member

Could we add a test case to avoid this regression in the future?

@fwouts
Copy link
Contributor Author

fwouts commented Sep 24, 2021

Could we add a test case to avoid this regression in the future?

I'd love to, I'm just not sure how to reproduce with a simple codebase 😬

@patak-dev
Copy link
Member

Oh, sorry didn't see the explanation in the issue. We'll ask Evan today about this 👍🏼

@patak-dev patak-dev added the p3-minor-bug An edge case that only affects very specific usage (priority) label Sep 24, 2021
@patak-dev patak-dev merged commit 9164da0 into vitejs:main Sep 24, 2021
@fwouts fwouts deleted the replace-base-url branch September 24, 2021 22:22
@fwouts
Copy link
Contributor Author

fwouts commented Sep 24, 2021

Thank you both! 🚀

aleclarson pushed a commit to aleclarson/vite that referenced this pull request Nov 8, 2021
* fix: normalize away `base` in imported URLs

This fixes hot-reloading issues reported in vitejs#5063.

* Update importAnalysis.ts

Co-authored-by: Evan You <yyx990803@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants