File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
packages/vite/src/node/optimizer Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -790,17 +790,16 @@ function findInteropMismatches(
790790 const needsInteropMismatch = [ ]
791791 for ( const dep in discovered ) {
792792 const discoveredDepInfo = discovered [ dep ]
793+ if ( discoveredDepInfo . needsInterop === undefined ) continue
794+
793795 const depInfo = optimized [ dep ]
794- if ( depInfo ) {
795- if (
796- discoveredDepInfo . needsInterop !== undefined &&
797- depInfo . needsInterop !== discoveredDepInfo . needsInterop
798- ) {
799- // This only happens when a discovered dependency has mixed ESM and CJS syntax
800- // and it hasn't been manually added to optimizeDeps.needsInterop
801- needsInteropMismatch . push ( dep )
802- debug ?.( colors . cyan ( `✨ needsInterop mismatch detected for ${ dep } ` ) )
803- }
796+ if ( ! depInfo ) continue
797+
798+ if ( depInfo . needsInterop !== discoveredDepInfo . needsInterop ) {
799+ // This only happens when a discovered dependency has mixed ESM and CJS syntax
800+ // and it hasn't been manually added to optimizeDeps.needsInterop
801+ needsInteropMismatch . push ( dep )
802+ debug ?.( colors . cyan ( `✨ needsInterop mismatch detected for ${ dep } ` ) )
804803 }
805804 }
806805 return needsInteropMismatch
You can’t perform that action at this time.
0 commit comments