0

I'm trying to setup Jest with Konva, but getting this error:

TypeError: Cannot read property 'Stage' of undefined

  88 |     }
  89 |
> 90 |     const stage = new Konva.Stage({

I have imported Konva with import Konva from 'konva' in my TS file, and it works when I change that to import * as Konva from 'konva'

Is there a workaround to fix this module resolution on Jest?

Ramin Mousavi
  • 486
  • 1
  • 5
  • 19

1 Answers1

1

I added these properties to my tsconfig.json and the issue resolved:

{
 "allowSyntheticDefaultImports": true,
 "esModuleInterop": true
}
Ramin Mousavi
  • 486
  • 1
  • 5
  • 19