TypeScript
TypeScript copied to clipboard
No Project on updateOpen in nhn/tui.editor
nhn/tui.editor Repro is open this, then close it, then open this. AFAICT, opening the first file loads the root tsconfig, which contains the second file. When the second file is opened, the scriptinfo already exists and the root tsconfig is the only containing project. However, it promptly discovers the nearest tsconfig and triggers a cleanup, retaining only that project. It does not seem to actually add the nearby project to the list of containing projects, though it might later, during graph update. One quick fix might be to just skip the telemetry call that's throwing if there are no containing projects (pending graph update).
Originally posted by @amcasey in https://github.com/microsoft/TypeScript/issues/50835#issuecomment-1251723826
nhn/tui.editor
:warning: Note that typescript-4.8.3 also had errors :warning:
Req #48 - updateOpen
at Object.ThrowNoProject (/typescript-4.8.3/lib/tsserver.js:170301:23)
at ScriptInfo.getDefaultProject (/typescript-4.8.3/lib/tsserver.js:171144:46)
at ProjectService.telemetryOnOpenFile (/typescript-4.8.3/lib/tsserver.js:176529:42)
at /typescript-4.8.3/lib/tsserver.js:176611:76
at ProjectService.applyChangesInOpenFiles (/typescript-4.8.3/lib/tsserver.js:176611:37)
at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/typescript-4.8.3/lib/tsserver.js:177974:46)
at /typescript-4.8.3/lib/tsserver.js:180166:96
at IOSession.Session.executeWithRequestId (/typescript-4.8.3/lib/tsserver.js:180157:28)
at IOSession.Session.executeCommand (/typescript-4.8.3/lib/tsserver.js:180166:41)
at IOSession.Session.onMessage (/typescript-4.8.3/lib/tsserver.js:180194:35)
at Interface.<anonymous> (/typescript-4.8.3/lib/tsserver.js:184330:31)
Req #48 - updateOpen
at Object.ThrowNoProject (/typescript-4.9.0-dev.20220918/lib/tsserver.js:171421:23)
at ScriptInfo.getDefaultProject (/typescript-4.9.0-dev.20220918/lib/tsserver.js:172264:46)
at ProjectService.telemetryOnOpenFile (/typescript-4.9.0-dev.20220918/lib/tsserver.js:177649:42)
at /typescript-4.9.0-dev.20220918/lib/tsserver.js:177731:76
at ProjectService.applyChangesInOpenFiles (/typescript-4.9.0-dev.20220918/lib/tsserver.js:177731:37)
at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/typescript-4.9.0-dev.20220918/lib/tsserver.js:179094:46)
at /typescript-4.9.0-dev.20220918/lib/tsserver.js:181286:96
at IOSession.Session.executeWithRequestId (/typescript-4.9.0-dev.20220918/lib/tsserver.js:181277:28)
at IOSession.Session.executeCommand (/typescript-4.9.0-dev.20220918/lib/tsserver.js:181286:41)
at IOSession.Session.onMessage (/typescript-4.9.0-dev.20220918/lib/tsserver.js:181314:35)
at Interface.<anonymous> (/typescript-4.9.0-dev.20220918/lib/tsserver.js:185436:31)
Last few requests
{"seq":45,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/apps/editor/rollup.config.js","line":61,"offset":17}}
{"seq":46,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/apps/editor/rollup.config.js","line":61,"offset":17,"includeExternalModuleExports":false,"includeInsertTextCompletions":true,"triggerKind":1}}
{"seq":47,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/__mocks__/cssMock.js"],"openFiles":[]}}
{"seq":48,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/apps/editor/scripts/createConfigVariable.js","projectRootPath":"@PROJECT_ROOT@"}]}}
Repro Steps
git clone https://github.com/nhn/tui.editor --recurse-submodule- In dir
tui.editor, rungit reset --hard 06355b6c1885fa2b5109209e93292c7f2367e4d7 Install packages (exact steps below, but probably easier to follow repo readme)
- In dir
tui.editor/apps/editor, runnpm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q - In dir
tui.editor/apps/react-editor, runnpm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q - In dir
tui.editor/apps/vue-editor, runnpm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q - In dir
tui.editor/libs/toastmark, runnpm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q - In dir
tui.editor, runnpm ci --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q - In dir
tui.editor/plugins/chart, runnpm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q - In dir
tui.editor/plugins/code-syntax-highlight, runnpm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q - In dir
tui.editor/plugins/color-syntax, runnpm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q - In dir
tui.editor/plugins/table-merged-cell, runnpm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q - In dir
tui.editor/plugins/uml, runnpm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
- In dir
- Download
RepoResults3/nhn.tui.editor.replay.txtfrom the artifact folder npm install --no-save @typescript/server-replaynpx tsreplay ./tui.editor ./nhn.tui.editor.replay.txt path/to/tsserver.js
Slightly different stack, but seems similar:
gatsbyjs/gatsby
:warning: Note that typescript-4.8.3 also had errors :warning:
Req #3944 - references
at Object.ThrowNoProject (/typescript-4.8.3/lib/tsserver.js:170301:23)
at IOSession.Session.getProjects (/typescript-4.8.3/lib/tsserver.js:179137:42)
at IOSession.Session.getReferences (/typescript-4.8.3/lib/tsserver.js:179193:37)
at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/typescript-4.8.3/lib/tsserver.js:178032:61)
at /typescript-4.8.3/lib/tsserver.js:180166:96
at IOSession.Session.executeWithRequestId (/typescript-4.8.3/lib/tsserver.js:180157:28)
at IOSession.Session.executeCommand (/typescript-4.8.3/lib/tsserver.js:180166:41)
at IOSession.Session.onMessage (/typescript-4.8.3/lib/tsserver.js:180194:35)
at Interface.<anonymous> (/typescript-4.8.3/lib/tsserver.js:184330:31)
Req #3944 - references
at Object.ThrowNoProject (/typescript-4.9.0-dev.20220918/lib/tsserver.js:171421:23)
at IOSession.Session.getProjects (/typescript-4.9.0-dev.20220918/lib/tsserver.js:180257:42)
at IOSession.Session.getReferences (/typescript-4.9.0-dev.20220918/lib/tsserver.js:180313:37)
at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/typescript-4.9.0-dev.20220918/lib/tsserver.js:179152:61)
at /typescript-4.9.0-dev.20220918/lib/tsserver.js:181286:96
at IOSession.Session.executeWithRequestId (/typescript-4.9.0-dev.20220918/lib/tsserver.js:181277:28)
at IOSession.Session.executeCommand (/typescript-4.9.0-dev.20220918/lib/tsserver.js:181286:41)
at IOSession.Session.onMessage (/typescript-4.9.0-dev.20220918/lib/tsserver.js:181314:35)
at Interface.<anonymous> (/typescript-4.9.0-dev.20220918/lib/tsserver.js:185436:31)
Last few requests
{"seq":3941,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts","line":85,"offset":1}}
{"seq":3942,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/packages/gatsby-plugin-google-gtag/index.d.ts"],"openFiles":[]}}
{"seq":3943,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/packages/gatsby-plugin-image/src/components/__tests__/gatsby-image.browser.tsx","projectRootPath":"@PROJECT_ROOT@"}]}}
{"seq":3944,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/packages/gatsby-plugin-image/src/components/__tests__/gatsby-image.browser.tsx","line":2,"offset":4}}
Repro Steps
git clone https://github.com/gatsbyjs/gatsby- In dir
gatsby, rungit reset --hard e91d5a6a46eec48820ab89cecc7ee3f0d2dc1780 - Download
RepoResults1/gatsbyjs.gatsby.replay.txtfrom the artifact folder npm install --no-save @typescript/server-replaynpx tsreplay ./gatsby ./gatsbyjs.gatsby.replay.txt path/to/tsserver.js
Reduced (use this in place of gatsbyjs.gatsby.replay.txt)
{"rootDirPlaceholder":"@PROJECT_ROOT@","serverArgs":["--disableAutomaticTypingAcquisition"]}
{"seq":1,"type":"request","command":"configure","arguments":{"preferences":{"includePackageJsonAutoImports":"off"},"watchOptions":{"excludeDirectories":["**/node_modules"]}}}
{"seq":3905,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/packages/gatsby-plugin-google-gtag/index.d.ts","projectRootPath":"@PROJECT_ROOT@"}]}}
{"seq":3942,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/packages/gatsby-plugin-google-gtag/index.d.ts"],"openFiles":[]}}
{"seq":3943,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/packages/gatsby-plugin-image/src/components/__tests__/gatsby-image.browser.tsx","projectRootPath":"@PROJECT_ROOT@"}]}}
{"seq":3944,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/packages/gatsby-plugin-image/src/components/__tests__/gatsby-image.browser.tsx","line":2,"offset":4}}