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 'Failed to resolve import' crash during ssr #1496

Merged
merged 5 commits into from
May 23, 2024

Conversation

Brendonovich
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • infrastructure changes
  • Other... Please describe:

What is the current behavior?

If during SSR a vite error is encountered (such as a module not existing after a rename), vinxi's import function will throw, leading to the dev server crashing instead of being shown on the error overlay.

What is the new behavior?

The error is now caught, the dev server no longer crashes, and the error is shown in the overlay.
When the module isn't found, lazyRoute will just return a no-op component so that the route can continue to resolve essentially as a no-op, since the error will surface itself in the Vite overlay anyway (not sure how to make it appear in the SS error overlay).

Other information

This solves at least part of nksaraf/vinxi#119

Copy link

changeset-bot bot commented May 22, 2024

🦋 Changeset detected

Latest commit: 2adc8f1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/start Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ryansolid ryansolid merged commit 3ec4138 into solidjs:main May 23, 2024
1 check passed
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.

2 participants