Skip to content

Fix raw ENOENT when a web pixel bundle is missing with --no-build - #9049

Open
isaacroldan wants to merge 1 commit into
mainfrom
torrent/cli-5-abort-with-a-clear-error-when-a-web-pixe
Open

isaacroldan wants to merge 1 commit into
mainfrom
torrent/cli-5-abort-with-a-clear-error-when-a-web-pixe

Conversation

@isaacroldan

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

app deploy --no-build with a web pixel extension that was never built fails with a raw filesystem error:

ENOENT: no such file or directory, stat '<extension>/dist/<handle>.js'

buildUIExtension runs the extension's buildValidation before the bundle_ui step checks that the build output exists. The web pixel validation reads the bundle size, so it fails first, and the clear missing-output error never shows.

WHAT is this pull request doing?

When skipBuild is set and the bundle file does not exist, buildUIExtension now throws the same AbortError as the bundle_ui step, before buildValidation runs. The error moves into a MissingBuildOutputError class, so both places print the same message.

Output after the change:

Couldn't find the build output at <extension>/dist/<handle>.js

If you passed --no-build, build the app first. Otherwise check that building the extension produces files at that path.

How to manually test your changes?

  1. In an app with a web pixel extension, delete the extension's dist directory.
  2. Run shopify app deploy --no-build.
  3. Before: the command fails with ENOENT: no such file or directory, stat …. After: it fails with Couldn't find the build output at … and the --no-build hint.

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

With `app deploy --no-build`, buildUIExtension runs the extension's
buildValidation before anything checks that the bundle exists. The web
pixel validation reads the bundle size, so a missing bundle failed with
a raw ENOENT instead of the missing-output AbortError of the bundle_ui
step.

Check for the output file before buildValidation when skipBuild is set,
and throw the same error. Move that error into a MissingBuildOutputError
class so both places print the same message.

Co-authored-by: isaac.roldan <isaac.roldan@shopify.com>
@github-actions github-actions Bot added the Area: @shopify/app @shopify/app package issues label Oct 30, 2026
@isaacroldan
isaacroldan marked this pull request as ready for review October 30, 2026 12:55
@isaacroldan
isaacroldan requested a review from a team as a code owner October 30, 2026 12:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/app @shopify/app package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant