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: handle error without line and column in loc #12312

Merged
merged 2 commits into from
Mar 7, 2023

Conversation

fi3ework
Copy link
Member

@fi3ework fi3ework commented Mar 6, 2023

Description

fix #12293

Additional context

Delete err.loc when all the fields in it are nullish to prevent undefined in trace such like /Users/fi3ework/OSS/vite-repro/i12293/src/components/HelloWorld.vue?vue&type=style&index=0&scoped=e17ea971&lang.css:undefined:undefined.


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.

@stackblitz
Copy link

stackblitz bot commented Mar 6, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@benmccann
Copy link
Collaborator

Thanks for this! Do you think there's any test we can add?

@fi3ework
Copy link
Member Author

fi3ework commented Mar 7, 2023

Thanks for this! Do you think there's any test we can add?

Sure, but the logic here is a bit messy. I would like to add some basic tests later. Feel free to merge this first if the bug should be fixed soon.

patak-dev
patak-dev previously approved these changes Mar 7, 2023
@patak-dev patak-dev merged commit ce18eba into vitejs:main Mar 7, 2023
@fi3ework fi3ework deleted the i12293 branch March 7, 2023 11:59
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.

File import error message is incorrect
3 participants