Skip to content

Commit 259c695

Browse files
committed
fix(miniprogram-typescript): duplicated error reports
1 parent 18e6634 commit 259c695

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

glass-easel-miniprogram-typescript/src/project.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export class ProjectDirManager {
139139
private trackingComponents = Object.create(null) as Record<string, ComponentJsonData>
140140
private convertedExpr = Object.create(null) as Record<string, ConvertedExprCache>
141141
private pendingAsyncTasks = 0
142+
private firstScanDone = false
142143
wxmlEnvGetter: (tsFullPath: string, wxmlFullPath: string) => string | null = () => null
143144
onEntranceFileAdded: (fullPath: string) => void = () => {}
144145
onEntranceFileRemoved: (fullPath: string) => void = () => {}
@@ -156,7 +157,10 @@ export class ProjectDirManager {
156157
this.tsc = tsc
157158
this.tmplGroup = tmplGroup
158159
this.rootPath = rootPath
159-
this.vfs = new VirtualFileSystem(rootPath, firstScanCallback)
160+
this.vfs = new VirtualFileSystem(rootPath, () => {
161+
this.firstScanDone = true
162+
firstScanCallback()
163+
})
160164
this.vfs.onFileFound = (fullPath) => {
161165
this.handleFileOpened(fullPath)
162166
}
@@ -191,7 +195,7 @@ export class ProjectDirManager {
191195
this.asyncWxmlConvertedExprUpdate(`${compPath}.wxml`)
192196
this.onEntranceFileAdded(`${compPath}.wxml`)
193197
}
194-
} else if (isTsFile(fullPath)) {
198+
} else if (isTsFile(fullPath) && this.firstScanDone) {
195199
this.checkConvertedExprCache(`${compPath}.wxml`)
196200
this.forEachDirectDependantComponents(compPath, (compPath) => {
197201
this.checkConvertedExprCache(`${compPath}.wxml`)

0 commit comments

Comments
 (0)