You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to resolve path to module '@sentry/nestjs' #14789
import*asSentryfrom'@sentry/nestjs';importdotenvfrom'dotenv';dotenv.config();if(!process.env.SENTRY_DSN){thrownewError('process.env.SENTRY_DSN is not defined');}if(!process.env.SENTRY_ENV){thrownewError('process.env.SENTRY_ENV is not defined');}Sentry.init({dsn: process.env.SENTRY_DSN,sampleRate: 0.1,environment: process.env.SENTRY_ENV,});
If you look into filesystem, there won't be nestjs dir.
I've been able to successfully patch this by creating nestjs directory under node_modules/@sentry/nestjs/build/cjs/ and by putting all the files from aforementioned directory into it.
The error was gone after this.
Expected Result
Files location should correspond to what's declared in package.json
Actual Result
Files location and package.json declaration mismatch
it's end of year next week and most of sentry is on holiday. We'll do a release at the start of the new year!
In case you are still wondering what the issue was about.
Yup @AdityaZwing that was the thing we fixed, but it's also on the tooling given main/module has been effectively deprecated for exports field. eslint-plugin-import and similar tooling should really use exports instead of main/module
Activity
AbhiPrasad commentedon Dec 18, 2024
yup this feels like a bug, especially considering we have it properly defined in the exports conditions. Will fix!
fix(nestjs): Use correct main/module path in package.json (#14790)
AbhiPrasad commentedon Dec 19, 2024
We merged in #14791 - will make a release after we also merge in #14799
AdityaZwing commentedon Dec 20, 2024
In case you are still wondering what the issue was about.
AbhiPrasad commentedon Dec 20, 2024
it's end of year next week and most of sentry is on holiday. We'll do a release at the start of the new year!
Yup @AdityaZwing that was the thing we fixed, but it's also on the tooling given
main/modulehas been effectively deprecated forexportsfield.eslint-plugin-importand similar tooling should really useexportsinstead ofmain/module