-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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(build): fix resolution algorithm when build.ssr
is true
#9989
Conversation
build.ssr
is truebuild.ssr
is true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks a lot for the fix!
One improvement we could do before merging is to move the new tests to an existing playground. Our e2e CI is taking quite a bit of time already so we are trying to keep the number of playgrounds at check. Instead of importing real packages in the |
Hi @patak-dev, thanks for looking at this! I had gone that route initially and created packages in Log output from that branch
So, I've removed the real packages ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Thanks a lot for reworking the test cases and for the clear exposition of your steps on this PR.
@patak-dev @bluwy can we please get this merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realized a requested review from me. This looks good 👍 I second @ydcjeff's changes too before merging.
@patak-dev Do we have any timeline on when this would be released? It doesn't look like it made it into v3.1.4, but we're very keen to be able to move forward with our project. |
@benjervis would you send a PR cherry-picking this one to the |
@patak-dev I've opened #10354 |
Description
This PR fixes the resolution algorithm when
build.ssr
istrue
i.e. whentryNodeResolve
is called withssr: true
andexternalize: true
.I couldn't find any tests covering this edge case, so I added a fixture in
playground/ssr-resolve
.Related issues/PRs: #8420 #8421.
Additional context
The current resolution produces an invalid path here
vite/packages/vite/src/node/plugins/resolve.ts
Lines 719 to 721 in e7712ff
In the case of
autosuggest-highlight
,autosuggest-highlight/match
should resolve toautosuggest-highlight/match/index.js
, notautosuggest-highlight/match
+.js
which doesn't exist.with fix
without fix (main)
[processResult]
(autosuggest-highlight/match.js
doesn't exist).What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).