Title: TypeScript optional chaining causes parse error · Issue #687 · sourcegraph/javascript-typescript-langserver · GitHub
Open Graph Title: TypeScript optional chaining causes parse error · Issue #687 · sourcegraph/javascript-typescript-langserver
X Title: TypeScript optional chaining causes parse error · Issue #687 · sourcegraph/javascript-typescript-langserver
Description: Please refer to this minimal project, which contains a file src/main.ts with the following code: const val = null; console.log(val?.prop); javascript-typescript-langserver produces the following diagnostic on line 2: ts: Expression expec...
Open Graph Description: Please refer to this minimal project, which contains a file src/main.ts with the following code: const val = null; console.log(val?.prop); javascript-typescript-langserver produces the following di...
X Description: Please refer to this minimal project, which contains a file src/main.ts with the following code: const val = null; console.log(val?.prop); javascript-typescript-langserver produces the following di...
Opengraph URL: https://github.com/sourcegraph/javascript-typescript-langserver/issues/687
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeScript optional chaining causes parse error","articleBody":"Please refer to [this minimal project](https://github.com/raxod502/javascript-typescript-langserver-issue687), which contains a file `src/main.ts` with the following code:\r\n\r\n```typescript\r\nconst val = null;\r\nconsole.log(val?.prop);\r\n```\r\n\r\njavascript-typescript-langserver produces the following diagnostic on line 2:\r\n\r\n```\r\nts: Expression expected. [1109]\r\n```\r\n\r\nThis symptom suggests that perhaps somehow the language server is using a version or configuration of TypeScript which does not have support for [optional chaining, added in TypeScript 3.7](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html). However, every version of TypeScript on my machine is 3.9 or later.\r\n\r\nAs far as I can tell, no other syntax features are broken. I will note that optional chaining was previously working, but something changed when I migrated to a new machine. I have not been able to identify what could have caused the difference.\r\n\r\n### Environment information\r\n\r\nLanguage server path: `/usr/bin/javascript-typescript-stdio`\r\n\r\n```\r\n$ javascript-typescript-stdio --version\r\n2.11.3\r\n\r\n$ npx which -a tsc\r\n/home/raxod502/files/temp/example-project/node_modules/.bin/tsc\r\n/usr/bin/tsc\r\n\r\n$ ./node_modules/.bin/tsc --version\r\nVersion 3.9.6\r\n\r\n$ tsc --version\r\nVersion 3.9.5\r\n\r\n$ uname -a\r\nLinux shallan 5.6.16-1-MANJARO #1 SMP PREEMPT Wed Jun 3 14:26:28 UTC 2020 x86_64 GNU/Linux\r\n```\r\n\r\nLanguage server installed from [AUR](https://aur.archlinux.org/packages/javascript-typescript-langserver)\r\n\r\nLSP client: Emacs lsp-mode revision [`5c9959fdf0a7ea12031e6798a330beccbc55a771`](https://github.com/emacs-lsp/lsp-mode/commit/5c9959fdf0a7ea12031e6798a330beccbc55a771)\r\n\r\nLSP message log: [available on GitHub Gist](https://gist.github.com/raxod502/63c81f1cb3131cb694ebf148f44f865a)\r\n","author":{"url":"https://github.com/raxod502","@type":"Person","name":"raxod502"},"datePublished":"2020-07-10T16:54:38Z","url":"https://github.com/sourcegraph/javascript-typescript-langserver/issues/687"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e87e6fa3-6883-0ff0-f89b-dc15dd99227f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D25C:22DB35:113F4DB:1629410:6B0108E1 |
| html-safe-nonce | fc41c5fe7f1b7fbe730275121c22eeeec3a873a8c59fc7bb6f3528fe3780071c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjVDOjIyREIzNToxMTNGNERCOjE2Mjk0MTA6NkIwMTA4RTEiLCJ2aXNpdG9yX2lkIjoiMjQ1NDM0OTE3MTc4NDc0NzIzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 617f6c726b073261df9475128e62edf5db52c80cb10b15d0e7eddb4dd6be5045 |
| hovercard-subject-tag | issue:654910264 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sourcegraph/javascript-typescript-langserver/687/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c0d0deeb92bf384bb4930cdfc779646381d8280788be88e7adaa316d4e6f64fe/sourcegraph/javascript-typescript-langserver/issues/687 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c0d0deeb92bf384bb4930cdfc779646381d8280788be88e7adaa316d4e6f64fe/sourcegraph/javascript-typescript-langserver/issues/687 |
| og:image:alt | Please refer to this minimal project, which contains a file src/main.ts with the following code: const val = null; console.log(val?.prop); javascript-typescript-langserver produces the following di... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | raxod502 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/sourcegraph/javascript-typescript-langserver git https://github.com/sourcegraph/javascript-typescript-langserver.git |
| octolytics-dimension-user_id | 3979584 |
| octolytics-dimension-user_login | sourcegraph |
| octolytics-dimension-repository_id | 68805662 |
| octolytics-dimension-repository_nwo | sourcegraph/javascript-typescript-langserver |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 68805662 |
| octolytics-dimension-repository_network_root_nwo | sourcegraph/javascript-typescript-langserver |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width