Fix app deploy including stale dist files in the extension bundle - #8236
Open
alfonso-noriega wants to merge 1 commit into
Open
Fix app deploy including stale dist files in the extension bundle#8236alfonso-noriega wants to merge 1 commit into
alfonso-noriega wants to merge 1 commit into
Conversation
…ist files Assisted-By: devx/5fc43aa0-53a8-47e0-94e5-0f1620777a6c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Related to #6069.
Since 3.94.0 (0986095),
executeBundleUIStepbuilds the UI extension into the extension's localdist/directory and then copies the whole directory into the deploy bundle. Any stale file sitting indist/(a script built under an old handle, a dev's own bundler output, old sourcemaps/metafiles) ships inside the module.For web pixel extensions this is fatal: core's
FetchScriptContentrejects modules whose uploaded files contain more than one.js, soappVersionCreatefails with a generic "Version couldn't be created" even though every prior step (build, GCS upload) succeeds.dist/is gitignored, so reverting source changes doesn't clear it — which is why "the same source deployed fine before and now fails".Root cause analysis in this Slack thread. Server-side error message improvement in https://github.com/shop/world/pull/967972.
WHAT is this pull request doing?
bundle-ui-step.ts: instead of copying the entire local output directory, copy only the artifacts produced by the build —<output-name>.*for the main entry and each extra asset (which also covers their sourcemaps and.metafile.json). Stale files next to the built ones no longer ship..jsin the localdist/is excluded from the bundle; extra built assets (e.g.-conditions.js) are still copied.How to test your changes?
shopify.extension.toml(leaving the oldextensions/<pixel>/dist/<old-handle>.jsin place) and runshopify app deploy.appVersionCreatefails ("Version couldn't be created"); with it, only the freshly built script is included and the deploy succeeds.Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add