Adding 'rotate' to (dom canvas)

I’m writing a game based on the Hoot game jam template and I need to rotate an image. I see that the template is making some kind of reference to the CanvasRenderingContext2D API in modules/dom/canvas.scm. It seems that I need to add a reference to that API’s rotate function. Following canvas.scm’s example I add these lines at the bottom:

(define-foreign rotate!
“canvas” “rotate”
(ref extern) f64 → none)

This builds, but when run there’s a console error that says Uncaught (in promise) LinkError: import object field 'rotate' is not a Function

Am I misunderstanding something or missing some steps?

You also need to add this call to the imports defined in the game.js file like so:

  canvas: {
    ...
    setImageSmoothingEnabled: (ctx, enabled) =>
      (ctx.imageSmoothingEnabled = enabled == 1),
    rotate: (ctx, angle) => ctx.rotate(angle)
  },