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

feat(ssr): add importer path to error msg when invalid url import occur #11606

Merged
merged 6 commits into from Feb 18, 2023

Conversation

thomasskk
Copy link
Contributor

@thomasskk thomasskk commented Jan 6, 2023

Description

When a url fail to load there is no info in the error message about where the failed import occur which make it hard to debug especially during tests with vitest.

Additional context


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 PR Title 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.

@bluwy bluwy changed the title feat: add module path to error mssg when invalid url import occur feat(ssr): add importer path to error msg when invalid url import occur Feb 14, 2023
@bluwy bluwy added p2-nice-to-have Not breaking anything but nice to have (priority) feat: ssr labels Feb 14, 2023
bluwy
bluwy previously approved these changes Feb 14, 2023
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

This is actually really smart because when an incorrect import happens, there's very likely only one importer at a time. I refactored the code a bit, but this looks good to me.

sapphi-red
sapphi-red previously approved these changes Feb 17, 2023
@patak-dev patak-dev enabled auto-merge (squash) February 17, 2023 09:20
@bluwy bluwy disabled auto-merge February 17, 2023 09:38
@bluwy
Copy link
Member

bluwy commented Feb 17, 2023

Hmm there seems to be a real Windows issue in CI, likely a path/slash issue in the test.

@bluwy bluwy dismissed stale reviews from sapphi-red and themself via 03129d3 February 17, 2023 19:28
@patak-dev patak-dev merged commit 70729c0 into vitejs:main Feb 18, 2023
futurGH pushed a commit to futurGH/vite that referenced this pull request Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: ssr p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants