Skip to content

fix(dev): Register static assets without identifier for relative src paths#7502

Merged
MitchLillie merged 1 commit into
mainfrom
cx-register-assets-without-identifier
May 12, 2026
Merged

fix(dev): Register static assets without identifier for relative src paths#7502
MitchLillie merged 1 commit into
mainfrom
cx-register-assets-without-identifier

Conversation

@MitchLillie
Copy link
Copy Markdown
Contributor

@MitchLillie MitchLillie commented May 8, 2026

Summary

Static assets in UI extensions weren't resolving correctly when using relative paths like src='./cat.png'.

Root Cause

Assets were registered at target/identifier/file (e.g., target/assets/Shoe1.png), but relative paths like src='./Shoe1.png' resolve to target/Shoe1.png.

Changes

Dev server

Register assets at target/file instead of target/identifier/file:

- resolver?.set(\`\${urlSubpath}/\${file}\`, file)
+ resolver?.set(\`\${target}/\${file}\`, file)

Deploy

Add destination: 'assets' to the include_assets step so files are copied to assets/ subdirectory with correct manifest paths.

Note

A corresponding server-side fix is needed to use the full manifest paths when constructing CDN URLs.

Fixes #5285

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label May 8, 2026
@MitchLillie MitchLillie force-pushed the cx-register-assets-without-identifier branch 4 times, most recently from 85f9b3b to 8791cd8 Compare May 8, 2026 23:27
@MitchLillie MitchLillie force-pushed the cx-register-assets-without-identifier branch from 8791cd8 to 3670948 Compare May 11, 2026 18:33
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@MitchLillie MitchLillie temporarily deployed to breaking-change-approval May 11, 2026 18:35 — with GitHub Actions Inactive
@MitchLillie MitchLillie force-pushed the cx-register-assets-without-identifier branch from 3670948 to 98b390c Compare May 11, 2026 18:56
Static assets were registered at target/identifier/file (e.g., target/assets/file),
but relative paths like src='./cat.png' resolve to target/file.

Changes:
1. Dev server: Register assets at target/file instead of target/identifier/file
2. Deploy: Add destination: 'assets' so assets copy to assets/ subdirectory

Fixes #5285
@MitchLillie MitchLillie force-pushed the cx-register-assets-without-identifier branch from 98b390c to f9da828 Compare May 11, 2026 18:58
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Potential Breaking Changes Detected

This PR contains changes that may break the existing contract.

@shopify/dev_experience — this PR contains breaking changes that require coordination for the next major release. This check will remain failed until a member of the team approves the workflow run.

💬 Head to #help-dev-platform to discuss timing and plan the release.

📦 Major Version Changesets

The following changesets request a major version bump:

Changeset Package
thin-webs-notice.md '@shopify/plugin-did-you-mean': major
thin-webs-notice.md '@shopify/plugin-cloudflare': major
thin-webs-notice.md '@shopify/create-app': major
thin-webs-notice.md '@shopify/cli-kit': major
thin-webs-notice.md '@shopify/store': major
thin-webs-notice.md '@shopify/theme': major
thin-webs-notice.md '@shopify/app': major
thin-webs-notice.md '@shopify/cli': major
thin-webs-notice.md '@shopify/e2e': major

@MitchLillie MitchLillie temporarily deployed to breaking-change-approval May 11, 2026 19:00 — with GitHub Actions Inactive
@MitchLillie MitchLillie marked this pull request as ready for review May 11, 2026 20:39
@MitchLillie MitchLillie requested a review from a team as a code owner May 11, 2026 20:39
@MitchLillie MitchLillie added this pull request to the merge queue May 12, 2026
Merged via the queue into main with commit 99dd8c1 May 12, 2026
26 of 29 checks passed
@MitchLillie MitchLillie deleted the cx-register-assets-without-identifier branch May 12, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants