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: add position to import analysis resolve exception #18344

Merged

Conversation

hi-ogawa
Copy link
Collaborator

Description

While improving rollup plugin errors display on Vitest vitest-dev/vitest#6686, I noticed that the error thrown by resolve.exports such as Error: Missing "./xxx" specifier in "yyy" package doesn't have a code frame info.

I added try/catch for import analysis's this.resolve to add RollupError.pos.

Screenshots before and after

Example of an error when adding import "vite/no-such-export" to playground/resolve.

before

Screenshot From 2024-10-12 14-20-20

after

Screenshot From 2024-10-12 14-20-32

Copy link

stackblitz bot commented Oct 12, 2024

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

@hi-ogawa hi-ogawa marked this pull request as ready for review October 12, 2024 05:49
@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Oct 12, 2024
@bluwy bluwy merged commit 0fe95d4 into vitejs:main Oct 14, 2024
14 checks passed
@hi-ogawa hi-ogawa deleted the fix-import-analysis-resolve-error-position branch October 14, 2024 07:52
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.

3 participants