Skip to content

Fix ReferenceError in publish.js#5252

Merged
Tyriar merged 2 commits intoxtermjs:masterfrom
jtbandes:patch-1
Jan 8, 2025
Merged

Fix ReferenceError in publish.js#5252
Tyriar merged 2 commits intoxtermjs:masterfrom
jtbandes:patch-1

Conversation

@jtbandes
Copy link
Copy Markdown
Contributor

In this workflow run, a 404 error was encountered, but this was followed by a ReferenceError because error is not defined in this file.

npm error code E404
npm error 404 Not Found - PUT https://registry.npmjs.org/@xterm%2fxterm - Not found
npm error 404
npm error 404  '@xterm/[email protected]' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2024-12-12T14_38_06_501Z-debug-0.log
/home/runner/work/xterm.js/xterm.js/bin/publish.js:117
    error(`Spawn exited with code ${result.status}`);
    ^

ReferenceError: error is not defined
    at checkAndPublishPackage (/home/runner/work/xterm.js/xterm.js/bin/publish.js:117:5)
    at Object.<anonymous> (/home/runner/work/xterm.js/xterm.js/bin/publish.js:33:16)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49

});
if (result.status) {
error(`Spawn exited with code ${result.status}`);
process.exit(result.status);
Copy link
Copy Markdown
Contributor Author

@jtbandes jtbandes Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that exiting with the same status code is not too important, because the child process's status code is part of the error message already?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it doesn't matter so much

Copy link
Copy Markdown
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@Tyriar Tyriar added this to the 6.0.0 milestone Jan 8, 2025
@Tyriar Tyriar self-assigned this Jan 8, 2025
@Tyriar Tyriar enabled auto-merge January 8, 2025 17:27
@Tyriar Tyriar merged commit 6b53ab4 into xtermjs:master Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants