Skip to content

Commit

Permalink
fix: clear TS logs even if there are type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Callum McIntyre committed Oct 21, 2021
1 parent cd10410 commit 9465a41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/run-wasm-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ export class TSClient {
// The first time we run code, the fetch request for the lib data may still be pending.
const libData = await this.libData
const typeErrors = getTSTypeErrors(code, this.ts, libData)
this.logs = []

if (typeErrors.length === 0) {
// If there are no errors, we can run the code
this.logs = []

// eslint-disable-next-line no-eval
eval((await this.ts.transpile(code)) as string)
}
Expand Down

0 comments on commit 9465a41

Please sign in to comment.