Skip to content

Commit

Permalink
fix(typescript): fixed "output was not created" error for ts_project …
Browse files Browse the repository at this point in the history
…with supports_workers
  • Loading branch information
a-ignatov-parc authored and alexeagle committed May 30, 2021
1 parent fc880a3 commit 807b07b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/typescript/internal/worker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const reportWatchStatusChanged = (diagnostic) => {
worker.debug(ts.formatDiagnostic(diagnostic, formatHost));
};
function createWatchProgram(options, tsconfigPath, setTimeout) {
const host = createWatchCompilerHost(tsconfigPath, options, Object.assign(Object.assign({}, ts.sys), { setTimeout }), ts.createEmitAndSemanticDiagnosticsBuilderProgram, reportDiagnostic, reportWatchStatusChanged);
const host = createWatchCompilerHost(tsconfigPath, options, Object.assign(Object.assign({}, ts.sys), { setTimeout }), ts.createSemanticDiagnosticsBuilderProgram, reportDiagnostic, reportWatchStatusChanged);
return ts.createWatchProgram(host);
}
let workerRequestTimestamp;
Expand Down
6 changes: 3 additions & 3 deletions packages/typescript/internal/worker/worker_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function createWatchProgram(
options: ts.CompilerOptions, tsconfigPath: string, setTimeout: ts.System['setTimeout']) {
const host = createWatchCompilerHost(
tsconfigPath, options, {...ts.sys, setTimeout},
ts.createEmitAndSemanticDiagnosticsBuilderProgram, reportDiagnostic,
ts.createSemanticDiagnosticsBuilderProgram, reportDiagnostic,
reportWatchStatusChanged);

// `createWatchProgram` creates an initial program, watches files, and updates
Expand All @@ -57,7 +57,7 @@ let workerRequestTimestamp: number|undefined;
/**
* The typescript compiler in watch mode.
*/
let cachedWatchedProgram:|ts.WatchOfConfigFile<ts.EmitAndSemanticDiagnosticsBuilderProgram>|
let cachedWatchedProgram:|ts.WatchOfConfigFile<ts.SemanticDiagnosticsBuilderProgram>|
undefined;
/**
* Callback provided by ts.System which should be called at the point at which
Expand All @@ -68,7 +68,7 @@ let consolidateChangesCallback: ((...args: any[]) => void)|undefined;
let cachedWatchProgramArgs: string|undefined;

function getWatchProgram(args: string[]):
ts.WatchOfConfigFile<ts.EmitAndSemanticDiagnosticsBuilderProgram> {
ts.WatchOfConfigFile<ts.SemanticDiagnosticsBuilderProgram> {
const newWatchArgs = args.join(' ');

// Check to see if the watch program needs to be updated or if we can re-use the old one.
Expand Down
1 change: 1 addition & 0 deletions packages/typescript/test/ts_project/worker/second.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const second: string = 'second';

0 comments on commit 807b07b

Please sign in to comment.