Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.11.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Sentry.init();
Steps to Reproduce
package.json
:
{
"type": "module",
"dependencies": {
"@sentry/node": "^8.11.0"
}
}
index.js
:
import * as Sentry from '@sentry/node';
const main = async () => {
Sentry.init();
const other = await import(new URL('./other.cjs', import.meta.url));
console.log(other);
};
main();
other.cjs
:
exports['one.two'] = () => console.log('b');
Expected Result
It runs, outputting:
[Module: null prototype] {
default: { 'one.two': [Function (anonymous)] },
'one.two': [Function (anonymous)]
}
(this can be reproduced by commenting out the Sentry.init();
line)
Actual Result
It fails on a sytax error:
file://[snip]/other.cjs?iitm=true:21
let $one.two = _.one.two
^
SyntaxError: Unexpected token '.'
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:168:18)
at callTranslator (node:internal/modules/esm/loader:279:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:285:30)
at async link (node:internal/modules/esm/module_job:78:21)
Node.js v20.12.2
Metadata
Metadata
Assignees
Type
Projects
Status
No status