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.

Property 'red' does not exist on type '{ enabled: any; }'.

See original GitHub issue

I’m using chalk with vscode and getting these warning errors below:

Property 'red' does not exist on type '{ enabled: any; }'.

it’s a pretty simple thing i’m building:

const chalk = require("chalk")
let cmd = 'something'
console.log(chalk.yellow(cmd))

I wonder if there is some definition/typings file (for JS) or some other magic that’s going on that is confusing the VSCode typechecking?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

23reactions
joskuijperscommented, Jan 30, 2018

tried using the following, which does work:

import chalk from 'chalk';
3reactions
ChristosChristofidiscommented, May 10, 2018

if you are using import * as chalk from 'chalk'

then chalk.default.yellow(cmd) will work

Read more comments on GitHub >

github_iconTop Results From Across the Web

Property does not exist on type '{}' in TypeScript | bobbyhadz
The "Property does not exist on type '{}'" error occurs when we try to access or set a property that is not contained...
Read more >
TypeScript: Property does not exist on type '{}' - Stack Overflow
The error " Property 'fadeDiv' does not exist on type '{}'. " seems to be triggering on a line you haven't posted in...
Read more >
property 'title' does not exist on type 'never'.ts(2339) - You.com
If you get the "Property does not exist on type 'never'" error, chances are you forgot to explicitly type a value and it...
Read more >
Property 'albedoColor' does not exist on type 'Material' Err
this Err: is applied to all the red once. Property 'albedoColor' does not exist on type 'Material'. (this is an typescript file).
Read more >
Documentation - TypeScript 4.9
JavaScript's in operator can check whether a property exists on an object. Previously, TypeScript allowed us to narrow away any types that don't...
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