Skip to content

Commit 853a245

Browse files
committed
fix: double-escape newlines in Node version guard banner string
The \n in a TypeScript template literal becomes a literal newline in the JS output. Inside a double-quoted JS string that is a SyntaxError. Use \\n (four backslashes in TS source → \n in JS output) so the runtime sees proper escape sequences and prints formatted output.
1 parent 5bc6139 commit 853a245

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

script/bundle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const result = await build({
9696
banner: {
9797
// Check Node.js version (>= 22 required for node:sqlite) and suppress warnings
9898
js: `#!/usr/bin/env node
99-
if(parseInt(process.versions.node)<22){console.error("Error: sentry requires Node.js 22 or later (found "+process.version+").\n\nEither upgrade Node.js, or install the standalone binary instead:\n curl -fsSL https://cli.sentry.dev/install | bash\n");process.exit(1)}
99+
if(parseInt(process.versions.node)<22){console.error("Error: sentry requires Node.js 22 or later (found "+process.version+").\\n\\nEither upgrade Node.js, or install the standalone binary instead:\\n curl -fsSL https://cli.sentry.dev/install | bash\\n");process.exit(1)}
100100
{let e=process.emit;process.emit=function(n,...a){return n==="warning"?!1:e.apply(this,[n,...a])}}`,
101101
},
102102
sourcemap: true,

0 commit comments

Comments
 (0)