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): skip optional peer dep resolve #10593

Merged
merged 4 commits into from
Nov 14, 2022
Merged

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Oct 22, 2022

Description

fix #10255

Skip optional peer dep resolve when running the vite resolver through hookNodeResolve.

From the issue, technically it's impossible to have the optional peer dep resolved via hookNodeResolve, but there is a race condition that makes this happen that I can't minimize as a test case.

Additional context

I can't seem to replicate the test locally, so no tests added, but it is consistently reproducible with the issue repro.

I think we should remove hookNodeResolve in Vite 4. It has caused a lot of inconsistencies and bugs with features only working in CJS (which we're phasing out). I can try to attempt this in another PR.

I'd also like to backport this to v3


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.

@bluwy bluwy added p3-minor-bug An edge case that only affects very specific usage (priority) feat: ssr feat: deps optimizer Esbuild Dependencies Optimization labels Oct 22, 2022
@bluwy bluwy marked this pull request as draft October 22, 2022 13:25
@bluwy bluwy marked this pull request as ready for review November 14, 2022 08:22
@bluwy bluwy requested a review from aleclarson November 14, 2022 08:22
@patak-dev patak-dev merged commit 0a69985 into main Nov 14, 2022
@patak-dev patak-dev deleted the fix-optional-peer-dep-ssr branch November 14, 2022 17:16
bluwy added a commit that referenced this pull request Nov 15, 2022
patak-dev pushed a commit that referenced this pull request Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: deps optimizer Esbuild Dependencies Optimization 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.

Issue after upgrade using jsdom with optional dependencies
3 participants