make generate-images fails at node build/generate-images.js step #9140

Closed
opened 2025-11-02 08:30:36 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @rlee287 on GitHub (Jun 27, 2022).

Description

Instructions for reproducing the issue:

  1. docker pull node
  2. Clone the gitea repository and cd into the repo directory
  3. docker run -it --name 'gitea_regen_images' -v "$PWD":/usr/src/app -w /usr/src/app node:latest runuser -u node make generate-images to run make generate-images as per https://docs.gitea.io/en-us/customizing-gitea/#changing-the-logo for customizing the logo

Output of command 3:

$ docker run -it --name 'gitea_regen_images' -v "$PWD":/usr/src/app -w /usr/src/app node:latest runuser -u node make generate-images
npm install --no-save
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1

added 929 packages in 16s
npm install --no-save --no-package-lock fabric@5 imagemin-zopfli@7
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 259 packages, removed 7 packages, and changed 218 packages in 55s
node build/generate-images.js 
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createLowerCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:9300:50)
    at klass._initStatic (/usr/src/app/node_modules/fabric/dist/fabric.js:8974:12)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11590:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 1)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createUpperCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12465:39)
    at klass._initInteractive (/usr/src/app/node_modules/fabric/dist/fabric.js:11894:12)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11591:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 1)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createCacheCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12483:46)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11592:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 1)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createLowerCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:9300:50)
    at klass._initStatic (/usr/src/app/node_modules/fabric/dist/fabric.js:8974:12)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11590:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 3)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createUpperCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12465:39)
    at klass._initInteractive (/usr/src/app/node_modules/fabric/dist/fabric.js:11894:12)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11591:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 3)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createCacheCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12483:46)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11592:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 3)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createLowerCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:9300:50)
    at klass._initStatic (/usr/src/app/node_modules/fabric/dist/fabric.js:8974:12)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11590:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 4)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createUpperCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12465:39)
    at klass._initInteractive (/usr/src/app/node_modules/fabric/dist/fabric.js:11894:12)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11591:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 4)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createCacheCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12483:46)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11592:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 4)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createLowerCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:9300:50)
    at klass._initStatic (/usr/src/app/node_modules/fabric/dist/fabric.js:8974:12)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11590:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 5)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createUpperCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12465:39)
    at klass._initInteractive (/usr/src/app/node_modules/fabric/dist/fabric.js:11894:12)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11591:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 5)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at klass._createCacheCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12483:46)
    at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11592:12)
    at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23)
    at generate (file:///usr/src/app/build/generate-images.js:39:18)
    at async Promise.all (index 5)
    at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined
TypeError: Cannot read properties of null (reading 'scale')
    at generate (file:///usr/src/app/build/generate-images.js:42:7)
    at async Promise.all (index 1)
    at async main (file:///usr/src/app/build/generate-images.js:71:3)
make: *** [Makefile:766: generate-images] Error 1

Gitea Version

85d960d2a1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

N/A: issue does not involve running Gitea but rather an included dev tool (see Description)

Database

No response

Originally created by @rlee287 on GitHub (Jun 27, 2022). ### Description Instructions for reproducing the issue: 1. `docker pull node` 2. Clone the gitea repository and cd into the repo directory 3. `docker run -it --name 'gitea_regen_images' -v "$PWD":/usr/src/app -w /usr/src/app node:latest runuser -u node make generate-images` to run `make generate-images` as per https://docs.gitea.io/en-us/customizing-gitea/#changing-the-logo for customizing the logo Output of command 3: ``` $ docker run -it --name 'gitea_regen_images' -v "$PWD":/usr/src/app -w /usr/src/app node:latest runuser -u node make generate-images npm install --no-save npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1 added 929 packages in 16s npm install --no-save --no-package-lock fabric@5 imagemin-zopfli@7 npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. added 259 packages, removed 7 packages, and changed 218 packages in 55s node build/generate-images.js Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createLowerCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:9300:50) at klass._initStatic (/usr/src/app/node_modules/fabric/dist/fabric.js:8974:12) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11590:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 1) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createUpperCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12465:39) at klass._initInteractive (/usr/src/app/node_modules/fabric/dist/fabric.js:11894:12) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11591:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 1) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createCacheCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12483:46) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11592:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 1) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createLowerCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:9300:50) at klass._initStatic (/usr/src/app/node_modules/fabric/dist/fabric.js:8974:12) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11590:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 3) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createUpperCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12465:39) at klass._initInteractive (/usr/src/app/node_modules/fabric/dist/fabric.js:11894:12) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11591:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 3) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createCacheCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12483:46) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11592:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 3) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createLowerCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:9300:50) at klass._initStatic (/usr/src/app/node_modules/fabric/dist/fabric.js:8974:12) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11590:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 4) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createUpperCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12465:39) at klass._initInteractive (/usr/src/app/node_modules/fabric/dist/fabric.js:11894:12) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11591:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 4) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createCacheCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12483:46) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11592:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 4) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createLowerCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:9300:50) at klass._initStatic (/usr/src/app/node_modules/fabric/dist/fabric.js:8974:12) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11590:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 5) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createUpperCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12465:39) at klass._initInteractive (/usr/src/app/node_modules/fabric/dist/fabric.js:11894:12) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11591:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 5) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/usr/src/app/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/usr/src/app/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58) at klass._createCacheCanvas (/usr/src/app/node_modules/fabric/dist/fabric.js:12483:46) at klass.initialize (/usr/src/app/node_modules/fabric/dist/fabric.js:11592:12) at new klass (/usr/src/app/node_modules/fabric/dist/fabric.js:3052:23) at generate (file:///usr/src/app/build/generate-images.js:39:18) at async Promise.all (index 5) at async main (file:///usr/src/app/build/generate-images.js:71:3) undefined TypeError: Cannot read properties of null (reading 'scale') at generate (file:///usr/src/app/build/generate-images.js:42:7) at async Promise.all (index 1) at async main (file:///usr/src/app/build/generate-images.js:71:3) make: *** [Makefile:766: generate-images] Error 1 ``` ### Gitea Version 85d960d2a10ce6db4dd4e05f7831ff3b33beee65 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? N/A: issue does not involve running Gitea but rather an included dev tool (see Description) ### Database _No response_
GiteaMirror added the type/bug label 2025-11-02 08:30:36 -06:00
Author
Owner

@rlee287 commented on GitHub (Jun 27, 2022):

Update for anyone who runs into this later: the error only appears with the latest version of Node, using node:16 as the base image allows the script to run successfully.

@rlee287 commented on GitHub (Jun 27, 2022): Update for anyone who runs into this later: the error only appears with the latest version of Node, using `node:16` as the base image allows the script to run successfully.
Author
Owner

@saegl5 commented on GitHub (Oct 21, 2022):

just to chime in, in case anyone else encounters this error but doesn't use docker...

I encountered the same error ("Not implemented: HTMLCanvasElement.prototype.getContext") using the Canonical snap: sudo snap install node --classic
solution for me was to download and install node.js 16 directly from https://nodejs.org/en/

sudo snap install node --channel=18/stable --classic didn't work, either
maybe the snaps don't work because of sandboxing...

chow

@saegl5 commented on GitHub (Oct 21, 2022): just to chime in, in case anyone else encounters this error but _doesn't_ use docker... I encountered the same error ("Not implemented: HTMLCanvasElement.prototype.getContext") using the Canonical snap: `sudo snap install node --classic` solution for me was to download and install node.js 16 directly from [https://nodejs.org/en/](https://nodejs.org/en/) `sudo snap install node --channel=18/stable --classic` didn't work, either maybe the snaps don't work because of sandboxing... chow
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9140