Skip to content

Don't crash when the browser launcher is missing - #8886

Merged
isaacroldan merged 1 commit into
mainfrom
fix-crash-on-openurl
Oct 15, 2026
Merged

isaacroldan merged 1 commit into
mainfrom
fix-crash-on-openurl

Conversation

@isaacroldan

Copy link
Copy Markdown
Contributor

open resolves as soon as it calls spawn, before the OS reports whether the launcher exists. In a headless container without xdg-open, the failure arrives later as an error event on the child process. With no listener, Node throws it as an uncaught exception: openURL has already returned true, the CLI prints "Opened link", and then the global handler exits mid device-code poll with spawn xdg-open ENOENT.

Wait for the child's spawn or error event and keep an error listener attached, so a failed launch returns false. Device-code login then prints the "Open this link" fallback and keeps polling.

WHY are these changes introduced?

Fixes #0000

WHAT is this pull request doing?

How to manually test your changes?

Post-release steps

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

`open` resolves as soon as it calls `spawn`, before the OS reports whether
the launcher exists. In a headless container without `xdg-open`, the
failure arrives later as an `error` event on the child process. With no
listener, Node throws it as an uncaught exception: `openURL` has already
returned true, the CLI prints "Opened link", and then the global handler
exits mid device-code poll with `spawn xdg-open ENOENT`.

Wait for the child's `spawn` or `error` event and keep an `error`
listener attached, so a failed launch returns false. Device-code login then
prints the "Open this link" fallback and keeps polling.

Co-authored-by: Isaac Roldan <[email protected]>
@isaacroldan
isaacroldan requested a review from a team as a code owner October 14, 2026 11:22
@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/notifications-system.d.ts
@@ -26,7 +26,7 @@ declare const NotificationSchema: zod.ZodObject<{
     id: string;
     type: "info" | "error" | "warning";
     message: string;
-    frequency: "always" | "once" | "once_a_day" | "once_a_week";
+    frequency: "once" | "always" | "once_a_day" | "once_a_week";
     ownerChannel: string;
     title?: string | undefined;
     cta?: {
@@ -43,7 +43,7 @@ declare const NotificationSchema: zod.ZodObject<{
     id: string;
     type: "info" | "error" | "warning";
     message: string;
-    frequency: "always" | "once" | "once_a_day" | "once_a_week";
+    frequency: "once" | "always" | "once_a_day" | "once_a_week";
     ownerChannel: string;
     title?: string | undefined;
     cta?: {
@@ -86,7 +86,7 @@ declare const NotificationsSchema: zod.ZodObject<{
         id: string;
         type: "info" | "error" | "warning";
         message: string;
-        frequency: "always" | "once" | "once_a_day" | "once_a_week";
+        frequency: "once" | "always" | "once_a_day" | "once_a_week";
         ownerChannel: string;
         title?: string | undefined;
         cta?: {
@@ -103,7 +103,7 @@ declare const NotificationsSchema: zod.ZodObject<{
         id: string;
         type: "info" | "error" | "warning";
         message: string;
-        frequency: "always" | "once" | "once_a_day" | "once_a_week";
+        frequency: "once" | "always" | "once_a_day" | "once_a_week";
         ownerChannel: string;
         title?: string | undefined;
         cta?: {
@@ -122,7 +122,7 @@ declare const NotificationsSchema: zod.ZodObject<{
         id: string;
         type: "info" | "error" | "warning";
         message: string;
-        frequency: "always" | "once" | "once_a_day" | "once_a_week";
+        frequency: "once" | "always" | "once_a_day" | "once_a_week";
         ownerChannel: string;
         title?: string | undefined;
         cta?: {
@@ -141,7 +141,7 @@ declare const NotificationsSchema: zod.ZodObject<{
         id: string;
         type: "info" | "error" | "warning";
         message: string;
-        frequency: "always" | "once" | "once_a_day" | "once_a_week";
+        frequency: "once" | "always" | "once_a_day" | "once_a_week";
         ownerChannel: string;
         title?: string | undefined;
         cta?: {

@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from 1cdbfa2a39c2efde8a731296abc9694eb8379eec. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/[email protected]

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@isaacroldan
isaacroldan added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit 7129f8c Oct 15, 2026
29 of 31 checks passed
@isaacroldan
isaacroldan deleted the fix-crash-on-openurl branch October 15, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants