Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ember build fails if a new project has @embroider/macros and fabric.js installed #567

Open
jakesjews opened this issue Oct 13, 2020 · 5 comments

Comments

@jakesjews
Copy link
Contributor

If the latest @embroider/macros and fabric.js are installed in a new Ember project then running ember build fails with this error.

Build Error (broccoli-persistent-filter:Babel > [Babel: @embroider/macros]) in @embroider/macros/runtime.js

Module did not self-register: '/Users/jacob/dev/tmp/embroider-fabric-bug/node_modules/canvas/build/Release/canvas.node'.

If @embroider/macros is removed then builds work again. I ran into this issue while trying to upgrade ember-bootstrap.

A replication is available here.

@AndreJoaquim
Copy link

AndreJoaquim commented Mar 2, 2021

Hello @ef4! Do you have any idea how could we fix this? I'm not being able to update some packages (e.g. ember-power-select) in my application due to this 😢

I believe this is ultimately caused by the canvas package, that's not necessary in the browsers, right? So, could we ignore this package some how? :)

@dwickern
Copy link

Since yarn v2 no longer has the --ignore-optional flag, here's my current workaround:

yarn add --dev canvas@dwickern/canvas-noop

It will replace canvas with this empty package

@ef4
Copy link
Contributor

ef4 commented Mar 18, 2021

Thanks for sharing a reproduction. Running the reproduction, I did see the bug, once. But try as I might I can't get it to reproduce a second time. Removing node modes and clearing the npm cache doesn't do it.

I suspect this is a transient problem caused by NPM. Does it happen reliably for you?

@AndreJoaquim
Copy link

@ef4 Yes, in my case it happens every time I boot up the application

@cloke
Copy link

cloke commented Mar 24, 2021

@ef4 I get this 100% of the time if I update ember past 3.20 (although it doesn't seem to be specific to upgrading ember, trying to update font awesome while on 3.20 triggers the same issue). I'm happy to provide any logs if it helps. I posted this in discord as well and can be contacted via Cloke there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants