Closed tobiasmuehl closed 1 month ago
This looks to be a problem of usage with the CJS/ESM, I think there are two way to solve your problem:
require
syntax with CJS.
const Sentry = require('@sentry/node');
import * as
syntax with ESM.
import * as Sentry from '@sentry/node';
require
doesn't play nicely with VSCode/intellisense. In the stackblitz example the import * as
seems to work, but it doesn't work in my actual app. I will investigate further.
jiti v2 introduces new jiti.import()
syntax that prefers native ESM imports.
If you have encountered any issues with v2 still, please ping to reopen or feel free to open new issue with reproduction 👍🏼
Environment
https://stackblitz.com/edit/stackblitz-starters-gpqjnv?file=index.ts&view=editor
Reproduction
In stackblitz terminal:
npx jiti index.ts
Describe the bug
Additional context
It can be fixed by fixing the imports, for example
Logs
No response