Closed vidhu closed 1 year ago
I've put up a PR for a potential fix https://github.com/getsentry/profiling-node/pull/122
Let me know if this is an acceptable approach!
@vidhu thanks for the detailed writeup and PR, definitely setting a great example of how to contribute 🏆 I left a tiny comment on your PR and we can be good to merge this.
@vidhu closing this issue as we merged the fix - we'll prepare a release sometime next week, thanks for your contribution!
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
SDK Version
0.3.0
Link to Sentry event
No response
What environment is your node script running in?
How is your code deployed and bundled?
Neither. Issue is on post install
Steps to Reproduce
yarn add @sentry/profiling-node
Expected Result
Binary for
...-darwin-arm64
is missing so I expect it to be compiled during thepostinstall
stepActual Result
Binary not build in yarn pnp
In the post install step, we try and
require(target)
Since CI doesn't build binaries for M1 Mac, the require fails and enters the
catch { }
block.In the catch block, we check the error messages and if it is a known error message, we attempt to compile the binaries.
This works fine in a typical npm / yarn set up since we end up matching on the
Cannot find module
error case.In yarn 2 pnp, the error message is different
Instead of enumerating the error messages for all the various package managers, I feel it would be better to first assert that the binary exists in the first place or not. If it doesn't, then compile, else try loading and catch the errors
Error Log
On
postinstall
failure, this is the error log