-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Node SDK generating Error: ENOENT: no such file or directory #12059
Comments
I am also seeing this, but with a different library (although it is slightly related, as it depends on discord.js): Error when loading '/app/dist/listeners/messageUpdate.js': [Error: ENOENT: no such file or directory, open '/app/node_modules/@sapphire/framework/dist/esm/@sapphire/result'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/app/node_modules/@sapphire/framework/dist/esm/@sapphire/result'
} This is the Dockerfile I am using: https://github.com/FozzieHi/FormulaOne/blob/87c9bdb9deb02ca6cc97f8ed3d1883f0e4be2716/Dockerfile I've checked the path, |
I've tried disabling source maps but that hasn't fixed it. I've taken a look at the directories again:
I'm not sure if it is somehow renaming the imports for these or not? |
It might be caused by a bug in |
|
Was experiencing this too. We use a mono repo for our product and the issue also occurs in those. Very annoying that this was not caught before the v8 release to be honest. It caused a 1h 30min downtime on a service for us in a Docker environment and took some investigation to figure out. |
Hey, sorry about that. We have done extensive testing and added a bunch of test applications testing various environments, but sadly with the breadth of the JS ecosystem it is impossible to test all possible scenarios. :( This is almost certainly a problem in import-in-the-middle, we're tracking upstream progress and will eventually try to contribute improvements there as well, if necessary. Sorry about the inconvenience! |
We're experiencing the same issue at Zendesk. Dynamic ESM imports stop working when Sentry 8 is installed. Have to keep using Sentry 7 for now. |
It's worth noting that you can disable the ESM module hooks by setting globalThis._sentryEsmLoaderHookRegistered = true;
Sentry.init({ You will lose OpenTelemetry auto-instrumentation but you'll still be able to use the rest of the SDK so this might help some upgrade in the meantime. |
Sorry, I found a merge bug in that patch. Could you try it again? |
We are also experiencing a similar issue in our Nuxt 3 monorepo. Disabling the ESM module hooks works for now. |
Hi @nishant-compro, Did you try the patch? If the patch doesn't work, this could be a different issue. |
The patch fixes the |
Hello, we've just released v8.8.0, which should hopefully resolve this ESM problem. Let us know if you updated and are still running into problems! |
The previous error is gone, however now I see
I’ve tried importing it in all ways: import { captureException } from '@sentry/astro';
import * as Sentry from '@sentry/astro';
(await import('@sentry/astro')).captureException; |
Do you mind opening a new issue for this? This will help us to track this properly and ensure we can resolve this as soon as we can! 🙏 |
Sure, I’ve created #12410 |
Just upgraded! My error with pupeteer are gone, and so are the instrumention error of Express. Great work!! |
resolves #12242 (although there are still some follow ups) https://github.com/open-telemetry/opentelemetry-js/releases/tag/v1.25.0 I think this lockfile looks correct, but lmk if this feels off. resolves #12011 resolves #12059 resolves #12154 resolves #12237 resolves nodejs/import-in-the-middle#77 cc @mohd-akram
Can confirm the issue was fixed, thanks! |
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
8.0.0.
Framework Version
Node v20.12.1
Link to Sentry event
https://ticket-tool-helper.sentry.io/issues/5357809318/?project=4507264120717312&query=is%3Aunresolved&referrer=issue-stream&stream_index=0
SDK Setup
Steps to Reproduce
I'm using https://github.com/discordjs/discord.js and since I updated to Sentry v8, without changing any of my other dependencies, I'm facing the following error in a function that is simply trying to import a discord.js class.
I think it's on sentry the root of the error given by the fact that when using
@sentry/[email protected]
this error didn't happen. If I remove my sentry init, the program will work fine tooExpected Result
The program would not detect any error
Actual Result
A
is captured as an error and stops the execution of the function that was doing an import
The text was updated successfully, but these errors were encountered: