#record error

3 messages · Page 1 of 1 (latest)

rigid juniper
#

guys why i get this typerror even i have if check,

                            if (
                                tailwindCssVariables[key] !== undefined &&
                                typeof tailwindCssVariables[key] !== 'string'
                            ) {
                                tailwindCssVariables[key].DEFAULT = color;
                            }
src/utils/vars.ts:72:33 - error TS2532: Object is possibly 'undefined'.

72                                 tailwindCssVariables[key].DEFAULT = color;

i don't get any such error in vscode, i see when i run tsc for type checking

rigid juniper
#

Pls help!!!!

dull iron
#

try assigning it to a variable first