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(ssr): improve missing file error #10880

merged 3 commits into from
Nov 12, 2022

fix(ssr): improve missing file error #10880

merged 3 commits into from
Nov 12, 2022


Copy link

@bluwy bluwy commented Nov 11, 2022


Fix #10002

When we can't read a file from the fs, transformRequest would return null, hiding the error.

This PR throws the error instead, with an error code to handle an edge case explained below. This would print a descriptive error when a file is missing instead.

Additional context

Partially reverts c30f6d7

The server transform middleware uses transformRequest, but for invalid urls, it needs to skip and let other middlewares handle instead. Skipping is now done by checking for the error code ERR_LOAD_URL.

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 Commit 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.

Copy link
Member Author

bluwy commented Nov 11, 2022

Putting this as draft as I see the tests being more flaky locally after this change. Gonna make sure it's safe before opening up.

@bluwy bluwy marked this pull request as ready for review November 12, 2022 02:50
Copy link
Member Author

bluwy commented Nov 12, 2022

Did a fresh install and tests are working fine now. Likely some caching issue before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

Improve developer experience by changing message "failed to load module for ssr"
3 participants