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

chore: show error position #13623

Merged
merged 1 commit into from
Jun 25, 2023
Merged

Conversation

sapphi-red
Copy link
Member

Description

Follow up to #13608.

#13608 removed the second argument of this.error in some places. This is correct as this.error only receives the second argument in the transform hook.
That said, it would be better to pass the pos and other properties to give rollup more information to generate a friendly error.
This PR adds those information.

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.

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Jun 25, 2023
@stackblitz
Copy link

stackblitz bot commented Jun 25, 2023

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

Comment on lines -224 to +226
this.error(e)
this.error(e, e.idx)
Copy link
Member Author

Choose a reason for hiding this comment

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

This this.error is in the transform hook. This was removed by mistake in #13608.

meta = minimalContext.meta!
meta = minimalContext.meta
Copy link
Member Author

Choose a reason for hiding this comment

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

This ! wasn't needed but added by #13608.

@patak-dev patak-dev merged commit 90271a6 into vitejs:main Jun 25, 2023
ailadas added a commit to ailadas/vite that referenced this pull request Jun 25, 2023
@sapphi-red sapphi-red deleted the chore/show-error-position branch June 26, 2023 02:31
xinxinhe1810 pushed a commit to xinxinhe1810/vite that referenced this pull request Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants