dnd icon indicating copy to clipboard operation
dnd copied to clipboard

Compilation error with Typescript

Open c-classen opened this issue 1 year ago • 0 comments

The file dev-warnings.ts contains the following line:

if (typeof window !== 'undefined' && window[isDisabledFlag]) {

which Typescript in my configuration does not accept, since the isDisabledFlag is not a known field of the window object (My configuration should be close to the default NextJS configuration):

Type error: Element implicitly has an 'any' type because index expression is not of type 'number'.

This can be fixed by adding an explicit any cast:

if (typeof window !== 'undefined' && window[isDisabledFlag as any]) {

c-classen avatar May 01 '23 09:05 c-classen