Open eatyourgreens opened 3 days ago
I think #6349 introduced this.
To be honest, the subject viewer is never rendered on the server, so node-canvas
isn't really needed in the build. On a personal level, I'm also not sure about the ethics of supporting Automattic at the moment.
Thanks! The brew install
shouldn't be necessary, because those Node binaries are never used.
--ignore-scripts
fixed the build for me. I don't think any of the post-install scripts are needed on MacOS.
The Docker builds use --ignore-scripts
, and the GitHub workflows too, so I've opened #6393 to add it to the bootstrap scripts. That will fix this by not building the canvas binaries.
Subject viewer tests run fine in Node, even without those binaries. I wasn't expecting that, to be honest.
After a bit of experimentation, it turns out you can completely remove canvas
from the Volumetric Viewer without breaking the tests or the storybook. It isn't used in the browser and the tests aren't using it to render <canvas>
in Node either.
TBH, given that the subject viewers are only ever run in browsers, never in Node, I'd test the Volumetric Viewer with Playwright rather than JSDOM. I've been using Playwright for some WebGL/canvas stuff I'm working on, and it just works out of the box. It also allows me to run my tests in Firefox, Chromium and Webkit, which is really useful.
Describe the bug
yarn bootstrap
fails on MacOS Sonoma when it tries to run post-install builds for thecanvas
package. My local build environment is:Here's the build output with the error.
To Reproduce
yarn bootstrap
and the build fails during theyarn install --frozen-lockfile
step.I'm not sure if there's something specific to my build environment that breaks the install just for me.node-canvas
has to be compiled from source on Apple CPUs.Additional context
To work around this, install with install scripts disabled. This is good security practice anyway, to guard against supply-chain attacks that install malware on your laptop from NPM.
I found this in the
node-canvas
Readme:I'm trying to bootstrap the monorepo on an M3 Macbook, so that explains why it's trying to compile
node-canvas
from source.