File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -429,7 +429,10 @@ export async function renderForPreview(
429429 // fileInformationCache contains file content that needs to be refreshed.
430430 // TODO(#13955): Consider adding a dedicated invalidateForFile() method on ProjectContext
431431 if ( project ?. fileInformationCache ) {
432- project . fileInformationCache . delete ( normalizePath ( file ) ) ;
432+ const normalizedFile = normalizePath ( file ) ;
433+ if ( project . fileInformationCache . has ( normalizedFile ) ) {
434+ project . fileInformationCache . delete ( normalizedFile ) ;
435+ }
433436 }
434437
435438 // render
Original file line number Diff line number Diff line change @@ -505,18 +505,17 @@ export const ensureFileInformationCache = (
505505 project : ProjectContext ,
506506 file : string ,
507507) => {
508- const normalizedFile = normalizePath ( file ) ;
509508 if ( ! project . fileInformationCache ) {
510509 project . fileInformationCache = new Map ( ) ;
511510 }
512511 assert (
513512 project . fileInformationCache instanceof Map ,
514513 JSON . stringify ( project . fileInformationCache ) ,
515514 ) ;
516- if ( ! project . fileInformationCache . has ( normalizedFile ) ) {
517- project . fileInformationCache . set ( normalizedFile , { } as FileInformation ) ;
515+ if ( ! project . fileInformationCache . has ( file ) ) {
516+ project . fileInformationCache . set ( file , { } as FileInformation ) ;
518517 }
519- return project . fileInformationCache . get ( normalizedFile ) ! ;
518+ return project . fileInformationCache . get ( file ) ! ;
520519} ;
521520
522521export async function projectResolveBrand (
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments