Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

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

@nickjs

Description

@nickjs

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions