Latest version fails to start plugin with `Cannot read property 'toString' of null`
See original GitHub issueHi Matt et al, thanks for the latest update to address workspace security. Unfortunately since installing 1.3.0, the typescript-tslint-plugin fails to start for all users in our organization’s workspace. I’m not sure if the problem lies in typescript-tslint-plugin
or on the vscode-typescript-tslint-plugin
side, nor how to helpfully debug to get a more accurate picture.
Here is the output from tsserver.log
:
Info 41 [17:35:30.47] [typescript-tslint-plugin] "Computing tslint semantic diagnostics for '/home/nsmall/go/src/github.com/...'"
Info 42 [17:35:30.47] [typescript-tslint-plugin] "(runTsLint) start"
Info 43 [17:35:30.47] [typescript-tslint-plugin] "(loadLibrary) trying to load /home/nsmall/go/src/github.com/..."
Info 44 [17:35:30.47] [typescript-tslint-plugin] "(getGlobalPackageManagerPath) Begin - Resolve Global Package Manager Path for: npm"
Info 45 [17:35:30.285] [typescript-tslint-plugin] "'npm config get prefix' value is: /home/nsmall/.npm-global"
Info 46 [17:35:30.286] [typescript-tslint-plugin] "(getGlobalPackageManagerPath) Done - Resolve Global Package Manager Path for: npm"
Info 47 [17:35:30.439] [typescript-tslint-plugin] "tslint error Cannot read property 'toString' of null"
A few notes on our environment, in case any of it contains a clue:
- We use yarn in the workspace, not npm
- We use yarn workspaces, but both
typescript
andtslint
dependencies are declared at the very top level of the workspace, in a file{workspaceRoot}/package.json
. - I confirmed that yarn has correctly installed
{workspaceRoot}/node_modules/.bin/tsc
and{workspaceRoot}/node_modules/.bin/tslint
- Also present:
{workspaceRoot}/tsconfig.json
and{workspaceRoot}/tslint.json
- I have followed your secondary instructions to enable workspace library execution from the command palette, though it results in no apparent changes in
{workspaceRoot}/.vscode/settings.json
. (Not sure if it should?) - Actual .tsx? files live at
{workspaceRoot}/frontend/{app}/src/**/*.tsx
, with each{app}
folder having its owntslint.json
that extends the one from the root. So{workspaceRoot}/frontend/{app}/tslint.json
contains"extends": ["../../tslint.json"]
. - We do have an npm global prefix set in all of our users’
.npmrc
:prefix = /home/{user}/.npm-global
, however nobody has a globally installed tslint in there; we’ve always relied on the workspace tslint binary.
Like I said, I’m not super sure how to provide good debugging information here, but if I had to offer a naive guess, it looks like it’s failing to load the workspace binary and trying to fall back to a global one, which we don’t have?
Happy to offer any more information I can! Thanks in advance!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (5 by maintainers)
Thanks @mjbvz, you’re my hero. 1.3.2 works great. Thanks again for all of your wonderful work in the community; may your bugs always be resolved quickly and easily 😃
Try 1.3.2 which was just published