question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Latest version fails to start plugin with `Cannot read property 'toString' of null`

See original GitHub issue

Hi 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 and tslint 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 own tslint.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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nickjscommented, Dec 15, 2020
Screen Shot 2020-12-15 at 11 19 46 AM

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 😃

0reactions
mjbvzcommented, Dec 15, 2020

Try 1.3.2 which was just published

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Cannot read property 'toString' of null' on all ruby files in vs code
Happens on every rb file I have tried in VS Code (Flatpak version). JS files work fine. Works fine if I call prettier...
Read more >
TypeError: Cannot read property 'toString' of Null in JS
The "Cannot read property 'toString' of null" error occurs when the toString() method is called on a null value. To solve the error,...
Read more >
Node.js - Cannot read property 'toString' of null when running ...
1. The issue probably is that transcludeStringSync will try to spawn another node process using child_process and that will probably fail on ...
Read more >
TypeError: Cannot read property 'toString' of null - Syncfusion
Forum Thread - TypeError: Cannot read property 'toString' of null - Vue.
Read more >
cannot read properties of null (reading 'aspath') - You.com
The cannot read property of null error occurs in JavaScript by: Calling a “click ()” function on a “null” value i.e DOM element...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found