Property 'red' does not exist on type '{ enabled: any; }'.
See original GitHub issueI’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:
- Created 6 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
tried using the following, which does work:
if you are using
import * as chalk from 'chalk'
then
chalk.default.yellow(cmd)
will work