TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

No Project on updateOpen in nhn/tui.editor

Open amcasey opened this issue 3 years ago • 2 comments

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

amcasey avatar Sep 20 '22 23:09 amcasey

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

  1. git clone https://github.com/nhn/tui.editor --recurse-submodule
  2. In dir tui.editor, run git reset --hard 06355b6c1885fa2b5109209e93292c7f2367e4d7
  3. Install packages (exact steps below, but probably easier to follow repo readme)
    1. In dir tui.editor/apps/editor, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    2. In dir tui.editor/apps/react-editor, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    3. In dir tui.editor/apps/vue-editor, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    4. In dir tui.editor/libs/toastmark, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    5. In dir tui.editor, run npm ci --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    6. In dir tui.editor/plugins/chart, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    7. In dir tui.editor/plugins/code-syntax-highlight, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    8. In dir tui.editor/plugins/color-syntax, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    9. In dir tui.editor/plugins/table-merged-cell, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    10. In dir tui.editor/plugins/uml, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
  4. Download RepoResults3/nhn.tui.editor.replay.txt from the artifact folder
  5. npm install --no-save @typescript/server-replay
  6. npx tsreplay ./tui.editor ./nhn.tui.editor.replay.txt path/to/tsserver.js

amcasey avatar Sep 20 '22 23:09 amcasey

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

  1. git clone https://github.com/gatsbyjs/gatsby
  2. In dir gatsby, run git reset --hard e91d5a6a46eec48820ab89cecc7ee3f0d2dc1780
  3. Download RepoResults1/gatsbyjs.gatsby.replay.txt from the artifact folder
  4. npm install --no-save @typescript/server-replay
  5. npx 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}}

amcasey avatar Sep 21 '22 17:09 amcasey