Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Server: canceled request with sequence number x #31817

Closed
scrossan-crown opened this issue Jun 5, 2019 · 15 comments
Closed

TypeScript Server: canceled request with sequence number x #31817

scrossan-crown opened this issue Jun 5, 2019 · 15 comments
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@scrossan-crown
Copy link

  • Version: 1.35.0-insider (user setup)
  • Commit: 553cfb2c2205db5f15f3ee8395bbd5cf066d357d
  • Date: 2019-06-04T00:13:30.572Z
  • Electron: 3.1.8
  • Chrome: 66.0.3359.181
  • Node.js: 10.2.0
  • V8: 6.6.346.32
  • OS: Windows_NT x64 10.0.17763

Steps to Reproduce:

  1. Open vscode
  2. Open a javascript or typescript file

Does this issue occur when all extensions are disabled?: Yes and I've also tried it with vscode insiders

[Info  - 15:53:48] Using tsserver from: z:\tenogo\websocket\node_modules\typescript\lib
[Info  - 15:53:48] TSServer log file: c:\Users\SCrossan\AppData\Roaming\Code - Insiders\logs\20190605T155323\exthost1\vscode.typescript-language-features\tsserver-log-NaLGEn\tsserver.log
[Info  - 15:53:48] Forking TSServer
[Info  - 15:53:49] Started TSServer
[Trace  - 15:53:49] Sending request: configure (0). Response expected: no. Current queue length: 0
Arguments: {
    "hostInfo": "vscode",
    "preferences": {
        "providePrefixAndSuffixTextForRename": true,
        "allowRenameOfImportPath": true
    }
}
[Trace  - 15:53:49] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0
Arguments: {
    "options": {
        "module": "commonjs",
        "target": "es2016",
        "jsx": "preserve",
        "allowJs": true,
        "allowSyntheticDefaultImports": true,
        "allowNonTsExtensions": true
    }
}
[Trace  - 15:53:49] Sending request: open (2). Response expected: no. Current queue length: 0
Arguments: {
    "file": "z:/tenogo/web/app/view/pages/job/items/index.tsx",
    "fileContent": "import * as React from 'react';\nimport { AppState } from \"../../../../store/types\";\nimport withStyles from \"@material-ui/core/styles/withStyles\";\nimport { Props, DispatchProps, StateProps, OwnProps } from './types';\nimport {connect} from \"react-redux\";\nimport Divider from '@material-ui/core/Divider';\nimport GridListTile from '@material-ui/core/GridListTile';\nimport Item from './item';\nimport {JobItem} from \"../../../../store/account/sites/jobs/jobItems/types/records\";\nimport styles from '../../../styles/main';\nimport Card from '@material-ui/core/Card';\nimport GridList from '@material-ui/core/GridList';\nimport { withRouter } from 'react-router';\n\nclass Component extends React.Component<Props>\n{\n    render () {\n        const {\n            match: { params: { job_item_id: jobItemID = '0' } },\n            jobItems,\n            classes,\n            edit = true\n        } = this.props;\n\n        // If a job item is selected in the job_item_id move that job item to 0 index\n        let filteredJobItems: JobItem[] = [];\n        if(!!jobItemID) {\n            const foundJobItem = jobItems.find(jobItem => jobItem.id === parseInt(jobItemID));\n\n            if(foundJobItem) {\n                filteredJobItems = [\n                    foundJobItem,\n                    ...jobItems.filter(jobItem => jobItem.id !== parseInt(jobItemID))\n\n                ];\n            }\n        }\n\n        if(filteredJobItems.length === 0) {\n            filteredJobItems = [ ...jobItems ];\n        }\n\n        return (\n            <Card>\n                <GridList\n                    cols={1}\n                    cellHeight={'auto'}\n                >\n                    {\n                        filteredJobItems.map( (jobItem) => (\n                            <div\n                                key={jobItem.id}\n                                style={{padding:0}}\n                            >\n                                <Divider/>\n                                <GridListTile cols={1} style={{}}>\n                                    <Item\n                                        jobItem={jobItem}\n                                        job={this.props.job}\n                                        expanded={ jobItemID ? (parseInt(jobItemID) == jobItem.id) : undefined }\n                                        edit={edit}\n                                    />\n                                </GridListTile>\n                            </div>\n                        ) )\n                    }\n                </GridList>\n            </Card>\n        )\n    }\n}\n\nconst ComponentWithRouter = withRouter(Component);\nconst ComponentWithStyles = withStyles(styles)(ComponentWithRouter);\nconst stateProps = () => ({});\nconst dispatchProps = {};\nconst ComponentConnect = connect<StateProps, DispatchProps, OwnProps, AppState>(\n    stateProps,\n    dispatchProps\n)(ComponentWithStyles);\nexport default ComponentConnect;",
    "scriptKindName": "TSX",
    "projectRootPath": "z:\\tenogo"
}
[Trace  - 15:53:49] Sending request: navtree (3). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "z:/tenogo/web/app/view/pages/job/items/index.tsx"
}
[Trace  - 15:53:49] TypeScript Server: trying to cancel ongoing request with sequence number 3
[Trace  - 15:53:49] TypeScript Server: canceled request with sequence number 5
[Trace  - 15:53:49] TypeScript Server: canceled request with sequence number 6
[Trace  - 15:53:49] Sending request: getSupportedCodeFixes (4). Response expected: yes. Current queue length: 1
[Trace  - 15:53:49] TypeScript Server: canceled request with sequence number 7
[Trace  - 15:53:49] TypeScript Server: canceled request with sequence number 8
[Trace  - 15:53:49] TypeScript Server: canceled request with sequence number 11
[Trace  - 15:53:49] TypeScript Server: canceled request with sequence number 12
[Trace  - 15:53:56] Event received: typingsInstallerPid (0).
Data: {
    "pid": 21828
}
[Trace  - 15:54:13] TypeScript Server: canceled request with sequence number 15
[Trace  - 15:54:13] TypeScript Server: canceled request with sequence number 9
[Trace  - 15:54:13] TypeScript Server: canceled request with sequence number 13
[Trace  - 15:54:14] TypeScript Server: canceled request with sequence number 14
[Trace  - 15:54:14] TypeScript Server: canceled request with sequence number 16
[Trace  - 15:54:14] TypeScript Server: canceled request with sequence number 17
[Trace  - 15:54:14] TypeScript Server: canceled request with sequence number 22
[Trace  - 15:54:15] TypeScript Server: canceled request with sequence number 18
[Trace  - 15:54:15] TypeScript Server: canceled request with sequence number 10
[Trace  - 15:54:15] TypeScript Server: canceled request with sequence number 28
[Trace  - 15:54:15] TypeScript Server: canceled request with sequence number 29
[Trace  - 15:54:15] TypeScript Server: canceled request with sequence number 30
[Trace  - 15:54:16] TypeScript Server: canceled request with sequence number 32
[Trace  - 15:54:16] TypeScript Server: canceled request with sequence number 31
[Trace  - 15:54:16] TypeScript Server: canceled request with sequence number 38
[Trace  - 15:54:16] TypeScript Server: canceled request with sequence number 39
[Trace  - 15:54:16] TypeScript Server: canceled request with sequence number 40
[Trace  - 15:54:17] TypeScript Server: canceled request with sequence number 42
[Trace  - 15:54:17] TypeScript Server: canceled request with sequence number 41
@vscodebot vscodebot bot assigned mjbvz Jun 5, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Jun 5, 2019

What TypeScript version are you using in your workspace? Does it this still happen if you use TypeScript 3.5.1?

@scrossan-crown
Copy link
Author

Yes I am currently using 3.5.1.

image

@scrossan-crown
Copy link
Author

The project I mainly work, the files are located on a remote server. When i created a copy locally it still displayed the above issue but after about 5 minutes it successfully initialized with full intellisense.

@mjbvz
Copy link
Contributor

mjbvz commented Jun 7, 2019

How are you loading the files from the remote server? A network drive? Some other approach?

@scrossan-crown
Copy link
Author

Via a network drive Z:

@scrossan-crown
Copy link
Author

I've left the intellisense running this morning when I got in today and it took about 30 minutes to fully initialize but it did and is now fully functional. Another issue I'm having (could be related to this issue) is that when I create a new file to it takes a long time to get any import intellisense, which slows down my development quite a bit.

@mjbvz mjbvz transferred this issue from microsoft/vscode Jun 7, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Jun 7, 2019

Is this a regression or has it always been this way? Also, can you try temporary removing any tsconfig.json files that you have so that we do not try reading in the entire workspace to provide intellisense. This could be slow on a network drive.

I also see you are opening a root folder on the Z: network drive in VS Code. About how many files does this contain? You can run code --status from the command line to get a rough idea of this

@mjbvz mjbvz removed their assignment Jun 7, 2019
@scrossan-crown
Copy link
Author

scrossan-crown commented Jun 10, 2019

The workspace I'm using is at z:\tenogo and the typscript project is located at z:\tenogo\web

output of code --status run at z:\tenogo\web

output of code --status run at z:\

Removing the tsconfig.json did allow it to initialize a lot faster.

@RyanCavanaugh RyanCavanaugh added the Needs More Info The issue still hasn't been fully clarified label Jun 13, 2019
@RyanCavanaugh
Copy link
Member

Impossible to say what's going on without a concrete repro

@mjbvz
Copy link
Contributor

mjbvz commented Jun 13, 2019

@RyanCavanaugh To provide full project intellisense, won't TS Server try to index the entire project? On a network drive, that could be very slow. I don't know if there's anything we can do to fix this unless we see that TS Server is being too eager in its indexing or something like that.

@scrossan-crown Can you check your TS Server log to see if the server is picking up unexpected files or indexing too much:

  1. Set "typescript.tsserver.log": "verbose",
  2. Restart VS Code and reproduce the problem
  3. In VS Code, run the TypeScript: Open TS Server log command
  4. This should open a file called tsserver.log file in it

Look through that log file for lists of project such as:

Info 1993 [14:3:55.711] Starting updateGraphWorker: Project: /Users/matb/projects/vscode/src/tsconfig.json
Info 1994 [14:3:55.878] Finishing updateGraphWorker: Project: /Users/matb/projects/vscode/src/tsconfig.json Version: 2 structureChanged: false Elapsed: 166ms
Info 1995 [14:3:55.878] Project '/Users/matb/projects/vscode/src/tsconfig.json' (Configured) 
Info 1996 [14:3:55.879] 	Files (1898)
	/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es5.d.ts
	/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.dom.d.ts
	/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.iterable.d.ts
	/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.symbol.d.ts
	/Users/matb/projects/vscode/src/typings/applicationInsights.d.ts
	/Users/matb/projects/vscode/src/typings/chokidar.d.ts
	/Users/matb/projects/vscode/node_modules/@types/node/inspector.d.ts
	/Users/matb/projects/vscode/node_modules/@types/node/index.d.ts
	/Users/matb/projects/vscode/src/typings/electron.d.ts
	/Users/matb/projects/vscode/src/typings/es2015-proxy.d.ts
...

If you can share the log, we can also take a look to see if anything stands out

⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

@scrossan-crown
Copy link
Author

@mjbvz is it possible for me to send you this log somewhere other than github?

Also It's only in the last couple of months that it's been this slow, before that it only took a minute or two to initialize. I'm happy to wait for the initial initialization but the biggest issue I face is when creating a new ts or tsx file it can take a long time for intellisense to be available in that file. I'm not sure it needs to re-index the whole project or why it's happening, but that slows things down a lot.

@mjbvz
Copy link
Contributor

mjbvz commented Jun 27, 2019

@scrossan-crown If they are not too large, you can email them to me: matb AT microsoft

@mjbvz
Copy link
Contributor

mjbvz commented Jul 29, 2020

Closing this issue as out of date.

If you are still seeing issue when using the latest TypeScript build, please open a new issue

@mjbvz mjbvz closed this as completed Jul 29, 2020
@carltheperson
Copy link

Had the same issue. For me, this worked:

  • npm install
  • Restart vs code

@microsoft microsoft locked as resolved and limited conversation to collaborators Apr 19, 2022
@mjbvz
Copy link
Contributor

mjbvz commented Apr 19, 2022

@carltheperson Please open a new issue instead of resurrecting an old closed one like this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

4 participants