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: transform error message add file info #13687

Merged
merged 5 commits into from Jul 17, 2023

Conversation

btea
Copy link
Collaborator

@btea btea commented Jun 30, 2023

Description

fix #13439

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.

@stackblitz
Copy link

stackblitz bot commented Jun 30, 2023

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

@bluwy
Copy link
Member

bluwy commented Jul 13, 2023

IIUC the original issue had this error:

4:18:50 PM [vite] Internal server error: EISDIR: illegal operation on a directory, read

Would this only append the file path to that error? I feel like the core issue is that we're cutting off additional information in that error that we shouldn't, so we can fix that instead of adding the .message manually.

@btea
Copy link
Collaborator Author

btea commented Jul 13, 2023

Would this only append the file path to that error?

Yes. The original error message was too terse and not informative, so I thought adding information about the file path would be helpful for troubleshooting.

image

@bluwy
Copy link
Member

bluwy commented Jul 17, 2023

Thanks. In that case I'm ok with patching this specific case for now then. Could we perhaps narrow down to the EISDIR error code and prepend only the file path so it looks like:

4:18:50 PM [vite] Internal server error: EISDIR: illegal operation on a directory, read /Users/foo/bar/apple.json

So the file paths follow nicely after the "read".

@bluwy bluwy added p3-minor-bug An edge case that only affects very specific usage (priority) feat: ssr labels Jul 17, 2023
@btea
Copy link
Collaborator Author

btea commented Jul 17, 2023

Ok. After I updated, now the error message looks like :

image

@bluwy
Copy link
Member

bluwy commented Jul 17, 2023

Thanks. Could we also only add the error message when e.code === 'EISDIR'?

@btea
Copy link
Collaborator Author

btea commented Jul 17, 2023

Thanks. Could we also only add the error message when e.code === 'EISDIR'?

Yeah, this should be better.

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
@bluwy bluwy merged commit 6dca41c into vitejs:main Jul 17, 2023
13 checks passed
@btea btea deleted the fix/enhance-transform-error-message branch July 17, 2023 13:54
@btea btea mentioned this pull request Aug 17, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: ssr 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.

Provide more context for EISDIR error
2 participants