fix: esbuildOutputFromId for symlinked root#10154
Merged
Conversation
|
After replacing function esbuildOutputFromId(outputs, id, cacheDirOutputPath) {
const flatId = flattenId(id) + '.js';
return outputs[normalizePath$3(path$n.relative(process.cwd(), path$n.join(cacheDirOutputPath, flatId)))];
}by function esbuildOutputFromId(outputs, id, cacheDirOutputPath) {
const cwd = process.cwd()
const flatId = flattenId(id) + '.js';
const normalizedOutputPath = normalizePath$3(
path$n.relative(cwd, path$n.join(cacheDirOutputPath, flatId))
)
const output = outputs[normalizedOutputPath]
if (output) {
return output
}
for (const [key, value] of Object.entries(outputs)) {
if (normalizePath$3(path$n.relative(cwd, key)) === normalizedOutputPath) {
return value
}
}
}in If I did the edit correctly. There is no more the error in the terminal. However, in this case there is in DevTools console. The site is not working. Running from the common folder (not sym-linked) still works ok. |
Member
Author
bluwy
approved these changes
Sep 18, 2022
Member
|
Yeah I think this PR looks good to merge.
This might be a different warning that was initially hidden by the bug this PR is fixing. We could gradually make the fixes to see what's causing this new issue too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #9327
I think this should work around the issue. It looks like esbuild is returning a redundant path when the root was symlinked (maybe it is something to fix at esbuild?). @AlttiRi @vricosti would you help us test this on Windows? I don't know if this is only one of the issues we will experience with this setup though.
What is the purpose of this pull request?