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

Cannot read property 'toString' of undefined #900

Closed
zlk89 opened this issue Jul 27, 2020 · 1 comment · Fixed by #901
Closed

Cannot read property 'toString' of undefined #900

zlk89 opened this issue Jul 27, 2020 · 1 comment · Fixed by #901

Comments

@zlk89
Copy link

zlk89 commented Jul 27, 2020

Description

Getting error when running any command:

> npx lint-staged --help -d
Cannot read property 'toString' of undefined

Steps to reproduce

  1. Upgrade macOS to Catalina 10.15.6
  2. Running any command will trigger this error.

Debug Logs

expand to view
xxx/node_modules/lint-staged/bin/lint-staged.js:8
  process.env.FORCE_COLOR = supportsColor.level.toString()
                                                  ^

TypeError: Cannot read property 'toString' of undefined
    at Object.<anonymous> (xxx/node_modules/lint-staged/bin/lint-staged.js:8:49)

Environment

  • OS: macOS Catalina 10.15.6
  • Node.js: v12.16.1
  • lint-staged: 10.2.11
@iiroj
Copy link
Member

iiroj commented Jul 28, 2020

Thanks for the issue!

EDIT: on further investigation, if supportsColor is truthy, it should always have a numeric supportsColor.level property.

In any case, I'll open a PR to double-check.

@iiroj iiroj linked a pull request Jul 28, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants