Closed CPatchane closed 6 months ago
It is mentioned in the docs: https://github.com/konvajs/konva?tab=readme-ov-file#4-nodejs-env
Note: I don't add canvas
into package.json
because the major part of use cases is frontend only. So I don't want to pollute node_modules
that is already too big everywhere.
Oops sorry I missed that info in the documentation, thanks for the link and that quick reply 🙌
Greetings 👋
I'd like to bring attention to an issue with the
konva
package. The Node.js version ofkonva
utilizes thecanvas
dependency, but it is not listed in thekonva
package.json. This omission leads to problems when installingkonva
using a package manager like pnpm, which only exposes necessary dependencies (compared to yarn v1 or npm).To reproduce this issue, install
konva
via pnpm and attempt to run Jest tests on files that usekonva
. You'll encounter the following error:This issue likely didn't exist when the Node.js version was separate, as in
konva-node
.Proposed Solution 1: Include
canvas
as a dependency inkonva
's package.json. This should resolve the issue. Proposed Solution 2: Mention in the documentation to installcanvas
when usingkonva
in a node environment.