You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(rolldown_plugin_vite_resolve): align bare import logic - #5247
Since I'm not very familiar with the related logic, I provided a quick workaround. We don't necessarily have to merge it — it's just to help you understand where the issue lies. @sapphi-red cc
The root cause is that we didn't align with the logic in resolve.ts. Specifically, we're missing the tryResolveBrowserMapping and tryNodeResolve logic. In this issue, it hits the tryNodeResolve branch, which leads to the problem.
The integration of rolldown-vite is as follows:
asyncfinalizeBareSpecifier(id,importer,scan){constenvironment=getEnv()constexternal=options.externalize&&options.isBuild&&partialEnv.config.consumer==='server'&&shouldExternalize(getEnv(),id,importer)constdepsOptimizer=resolveOptions.optimizeDeps&&environment.mode==='dev'
? environment.depsOptimizer
: undefined
let res: string|PartialResolvedId|undefinedif(!external&&options.asSrc&&depsOptimizer&&!scan&&(res=awaittryOptimizedResolve(depsOptimizer,id,importer,options.preserveSymlinks,options.packageCache,))){returnres}if(options.mainFields.includes('browser')&&(res=tryResolveBrowserMapping(id,importer,options,false,external,))){returnres}if((res=tryNodeResolve(id,importer,options,depsOptimizer,external,))){returnres}}
shulaoda
deleted the
07-11-fix_rolldown_plugin_vite_resolve_align_bare_import_logic
branch
July 11, 2025 06:41
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
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.
closes vitejs/rolldown-vite#288
Since I'm not very familiar with the related logic, I provided a quick workaround. We don't necessarily have to merge it — it's just to help you understand where the issue lies. @sapphi-red cc
The root cause is that we didn't align with the logic in resolve.ts. Specifically, we're missing the
tryResolveBrowserMappingandtryNodeResolvelogic. In this issue, it hits thetryNodeResolvebranch, which leads to the problem.The integration of rolldown-vite is as follows: