0

I am trying to use rollup to build a mini react component library of sorts, as soon as I add a react-konva component the errors appears, when I add the konva to the example I using to test the library it works fine leading me to assume its something with the way rollup handles konva. The only thing that I have seen on the github for react-konva that may link to this is: https://github.com/konvajs/react-konva/issues/504

  • My Rollup Config

  import peerDepsExternal from "rollup-plugin-peer-deps-external";
  import resolve from "@rollup/plugin-node-resolve";
  import commonjs from "@rollup/plugin-commonjs";
  import typescript from "rollup-plugin-typescript2";
  import postcss from "rollup-plugin-postcss";
  import image from "@rollup/plugin-image";
  
  const packageJson = require("./package.json");
  
  export default {
      input: "src/BuildScreen.tsx",
      output: [
          {
              file: packageJson.main,
              format: "cjs",
              sourcemap: true
          },
          {
              file: packageJson.module,
              format: "esm",
              sourcemap: true
          }
      ],
      plugins: [
          peerDepsExternal(),
          resolve(),
          commonjs(),
          typescript({ useTsconfigDeclarationDir: true }),
          postcss(),
          image()
      ]
  }

  • The Error enter image description here

If anything else is needed lmk, thanks in advance to anyone that helps

KieranLewin
  • 1,780
  • 2
  • 7
  • 13

1 Answers1

1

Well I look stupid, I randomly decided to change from duckduckgo to google to look up the issue and got a few github links for it one being https://github.com/konvajs/react-konva/issues/189 which made me think to remove my react konva and konva and reinstall it to the latest version and it worked my react-konva was on 16.13 or something and when I upgraded ended up on 17.0.0 which worked

KieranLewin
  • 1,780
  • 2
  • 7
  • 13