Skip to content

Fix missing index.html validation for admin extension during dev#7304

Closed
MitchLillie wants to merge 1 commit intomainfrom
cx-fix-index-html-on-dev
Closed

Fix missing index.html validation for admin extension during dev#7304
MitchLillie wants to merge 1 commit intomainfrom
cx-fix-index-html-on-dev

Conversation

@MitchLillie
Copy link
Copy Markdown
Contributor

What

This PR adds a buildValidation hook to the admin extension specification that checks for the presence of index.html in the static_root directory before starting the dev session.

Why

Fixes https://github.com/shop/issues-admin-extensibility/issues/2411

When an app with admin.static_root is created and dev is run immediately, the build step may not have completed yet, causing validation to fail on the server side with an unclear error message.

How

  • Added a buildValidation function to the admin extension specification
  • The validation checks if index.html exists in the configured static_root directory
  • If missing, it throws a clear AbortError with guidance to configure a predev hook
  • Added comprehensive tests for the new validation

Testing

  • Added unit tests for the buildValidation function
  • All existing tests pass

When an app with admin.static_root is created and dev is run immediately,
the build step may not have completed yet, causing validation to fail on
the server side with an unclear error message.

This change adds a buildValidation hook to the admin extension specification
that checks for the presence of index.html in the static_root directory
before starting the dev session. If the file is missing, it throws a clear
error message explaining the issue and suggesting to configure a predev hook.
@MitchLillie MitchLillie requested a review from a team as a code owner April 14, 2026 21:46
@MitchLillie MitchLillie marked this pull request as draft April 14, 2026 21:54
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.

1 participant