Repository navigation
Error: Cannot find module '/home/node/app/build/node_modules/@sentry/profiling-node on Sentry initialization. #11241
Description
Activity
- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2
on Mar 22, 2024 Just found a reply from Jonas in a similar issue (#10787 (comment)) saying that we attempt to compile the binary for your platform if we don't ship a precompiled binary. Can you check if you ignore scripts somewhere that would prevent compilation?
As I said in the first message, I'm running
yarn installto install dependencies. I'm not ignoring scriptsWe don't support Node 21 yet for the prebuilt binaries, we only generate binaries for Node 16-20.
I opened a PR to our docs to make this more clear getsentry/sentry-docs#9540
I don't think we'll be adding support for pre-building binaries to non-LTS versions of Node because of the potential instability of the ABI.
- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2
on Mar 22, 2024 2 remaining items
@hassenc If there are no errors, then the binary should be there. Are you running these commands from inside Docker? If there are no errors, then the binary should have been generated, can you verify that?
I wouldnt recommend updating the Docker image just yet, as we dont know yet what the actual issue is. From what I understand, you are saying that building the binaries from inside docker does not error, but the file is also not present, which is very odd.
- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2
on Mar 22, 2024 @hassenc yes, so indeed, the build fails and something swallows the error - I'm not exactly sure what, but if you do find out what makes this error invisible I'd love to know as we want it to throw at install time. I may investigate this myself, it's just not a big priority right now.
Like @AbhiPrasad said, we dont officially support non LTS Node versions, so the answer is very likely never for v21. That said, you can expect us to ship prebuilt binaries for version 22 (iirc there is currently no release date) when it enters LTS stage. My advice would be to downgrade to v20 where the binaries are available or install the correct tooling and compile from source, which slows down your docker build process like you noticed. You can likely speed up that part by leveraging a local or remote build cache for your image, which should make things substantially faster as you wont be reinstalling these expensive dependencies each time you build your docker image
Reacted by Hassen Chaieb and b santhosh- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2
on Mar 25, 2024 Switching from node v23.4.0 to v22.12.0 helped me solve this issue.
Reacted by DC, Tom and Israel PerezHow to check which node version is supported and which is not for prebuilt binaries?
Reacted by Muhammad Bin Jamil and Jacob Morrison
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status

Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
7.107.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
1 - When I run Sentry locally (node 21) , it runs as expected
2 - When I run Sentry on production, I get this error when the service starts
Docker image : node:21.2.0-alpine
Error: Cannot find module '/home/node/app/build/node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-x64-musl-120.node'Docker image : node:21.2.0-bullseye-slim
Error: Cannot find module '/home/node/app/build/node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-x64-glibc-120.node'When I look in
node_modules/@sentry/profiling-node/lib/the files are not there.I'm installing dependencies with
yarn install, and I'm not ignoring scripts3 - I reached out to Support, they said that node 21 is supported and that I should create an issue here
Expected Result
I think it's normal that the bianaries do not exist for node 21, but I would expect them to be compiled ?
Actual Result
Error: Cannot find module '/home/node/app/build/node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-x64-glibc-120.node'