Hello
It’s not a blocking issue for me, but I noticed that each time I launch a TS playground, fresh of any cache (for example just opening a new incognito window) it would trigger this error :
Could not find source file: ‘inmemory://model/1’.
(See red banner at bottom)
(Open playground in new incognito window to reproduce)
After a page reload, it would not trigger this error anymore. Any idea why this happens ? Am I the only one ?
Also, maybe related, I found a comment about this in the source code :
target: typescript.ScriptTarget.ESNext,
noLib: false,
strict: false,
alwaysStrict: false,
strictFunctionTypes: false,
suppressExcessPropertyErrors: false,
suppressImplicitAnyIndexErrors: true,
noResolve: true,
suppressOutputPathCheck: true,
allowNonTsExtensions: true, // required to prevent Uncaught Error: Could not find file: 'inmemory://model/1'.
});
typescript.typescriptDefaults.addExtraLib(libContent, "babylon.d.ts");
}
}
protected _setupDefinitionWorker(libContent: string) {
this._definitionWorker = new Worker("workers/definitionWorker.js");
this._definitionWorker.addEventListener("message", ({ data }) => {
this._tagCandidates = data.result;
this._analyzeCodeAsync();
After a quick search on the web, it indeed seems to be related to the Monaco Editor …
labris
December 2, 2024, 6:53pm
2
I have the same with the first opening of TS PG.
This happens because of race conditions in the Monaco editor when loading the typescript support. Once i update the editor it’ll go away.
And yes, it annoys me as well