Skip to content

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

Draft
MitchLillie wants to merge 1 commit intomainfrom
cx-register-assets-without-identifier
Draft

fix(dev): Register static assets without identifier for relative src paths#7502
MitchLillie wants to merge 1 commit intomainfrom
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 3 times, most recently from 476f4ae to 85f9b3b Compare May 8, 2026 21:43
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 85f9b3b to 8791cd8 Compare May 8, 2026 23:27
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.

1 participant