Closed felipearomani closed 9 months ago
Hi @felipearomani
I'm currently unable to reproduce the behaviour you are seeing. It would suggest to me that there is possibly an issue with finding the source maps, seeing as that's the step the bugsnag-source-maps
CLI is failing at, but we would usually expect an error message of No source maps found.
to be logged if this were the case. We're keen to gather some more information to reproduce this for ourselves and investigate the issue further.
yarn build
points to in your package.json
? Is this running tsc
?bugsnag-source-maps
CLI from the directory where build
is located? Can you also please confirm that a source map ending with .map
definitely exists in this build
directory when you are running the CLI?bugsnag cli version
, I'm presuming this is specifically the bugsnag-source-maps CLI. Are you able to try reinstalling this to your machine globally, and ensure that no version of this package is available locally in your NodeJS project? Then can you please attempt the CLI command again in a fresh terminal window.my-key
for the --api-key
option, I presume this is a placeholder, and you are actually passing in a valid API key when running the CLI?As this is a public thread, if there is any information you would prefer to share with us directly, then please feel free to open a support ticket with us by contacting support@bugsnag.com, and referencing this issue: https://github.com/bugsnag/bugsnag-source-maps/issues/90
Hi @mclack
Can you first confirm that there are definitely no source maps appearing in the BugSnag dashboard for the project in question after the CLI is run?
Yes, no source maps were sent to Bugsnag, I followed the path: Project > Project Settings > Upload mapping files > Source maps
and got the message "no source maps uploaded"
Can you also please confirm what command yarn build points to in your package.json? Is this running tsc?
Yes, it's there, and yes here we use tsc
.
A fragment of out package.json file:
"scripts":{
"build": "tsc",
}
our tsconfig.json
{
"compilerOptions": {
"sourceMap": true,
"removeComments": true,
"module": "CommonJS",
"moduleResolution": "node",
"target": "es2019",
"types": ["node", "jest"],
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"noEmit": false,
"skipLibCheck": true,
"preserveWatchOutput": true,
"assumeChangesOnlyAffectDirectDependencies": true,
"strict": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": "src",
"rootDir": "src",
"outDir": "build",
"isolatedModules": true
},
"exclude": ["node_modules", "scripts"],
"include": ["./src"]
}
Are you running the bugsnag-source-maps CLI from the directory where build is located? Can you also please confirm that a source map ending with .map definitely exists in this build directory when you are running the CLI?
Yes, I've been running on the project root, and when I build the project, it creates the build
folder at the same level. I tried running the command without the folder or passing the wrong folder to test and got the same error.
The .map files are there.
When you refer to bugsnag cli version, I'm presuming this is specifically the bugsnag-source-maps CLI.
Yes! You are correct!
Are you able to try reinstalling this to your machine globally, and ensure that no version of this package is available locally in your NodeJS project? Then can you please attempt the CLI command again in a fresh terminal window.
Yes, I tried, and another thing that I did was run it in my local machine and on our Kubernetes cluster using a Job deployment and got the same error result.
Is this NodeJS app using any type of framework? Like Koa, Express etc.
Yes, we use express and GraphQL, following a fragment of our package.json:
"dependencies": {
"@apollo/server": "4.9.3",
"@apollo/server-plugin-landing-page-graphql-playground": "4.0.1",
"@apollo/subgraph": "2.5.4",
"@bugsnag/js": "7.21.0",
"@bugsnag/plugin-express": "7.19.0",
"@bugsnag/source-maps": "2.3.1",
"express": "4.18.2",
"graphql": "16.8.1",
"graphql-parse-resolve-info": "4.13.0",
"graphql-relay": "0.10.0",
"graphql-sequelize": "9.5.1",
"graphql-tag": "2.12.6",
"graphql-voyager": "2.0.0",
"ts-node": "10.9.1",
"tsconfig-paths": "4.2.0",
"typescript": "5.2.2",
"utility-types": "3.10.0",
... other dependencies
},
When providing my-key for the --api-key option, I presume this is a placeholder, and you are actually passing in a valid API key when running the CLI?
Yes, it's a placeholder, I got my key in Project > Settings > Notifier API Key
and tried with my personal token in My Account Settings > Personal Auth Token
and got the same issue.
Hi @felipearomani
Thanks for the additional information.
We're aware that you have also opened a ticket with us regarding this issue by contacting support@bugsnag.com. As such, we will close the current issue on GitHub, and will continue to investigate this and provide support to you on the support ticket.
Hi everyone.
I have been facing an issue with the CLI that exits with code 1 without showing any log to help me debug.
I'm running the following command:
First, I build my nodeJS app, and it creates the
build
folder with my source maps because my tsconfig file has the optionsourceMaps: true
After that I run the following command:
So, I received the following output in my terminal.
After that, it exits with code 1 without logs to help me debug.
My Node version is: v18.18.2 My Yarn version is: 3.6.1 bugsnag cli version: v2.3.1
Any idea?