Repository navigation
fix(vite): emit the Android activity chunk under a stable name - #11539
Merged
Merged
Conversation
Core's Android activity is imported dynamically, so the build emits it as its own chunk, `activity.android-[hash].mjs`. The static binding generator writes that path into the generated Java activity at native build time. A rebuild that changed the hash left Java loading the previous build's chunk, still on the device, against the new vendor chunk, and the app crashed at launch with "isEmbedded is not a function". The activity chunk is now named `activity.android.mjs`, so its path stays the same across rebuilds. Other chunks keep their names.
|
View your CI Pipeline Execution ↗ for commit cbb83d3
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
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.
PR Checklist
What is the current behavior?
The Android activity chunk is emitted as
activity.android-[hash].mjs, and that name is baked into the generated Java activity at native build time. After a rebuild that changes the hash, Java still loads the old chunk, which is still on the device and imports vendor exports that no longer exist: the app crashes with "isEmbedded is not a function".What is the new behavior?
chunkFileNamesmoves intohelpers/chunk-file-names.ts, and theactivity.androidchunk is named[name].mjs. Vendor, worker and other chunk names are unchanged.Tests:
helpers/chunk-file-names.spec.tsruns a real build twice with different activity source and assertsactivity.android.mjsboth times (on main the name is hashed).Each new test fails without the change. The
@nativescript/vitesuite (163 files) andtsc -p tsconfig.lib.jsonpass on the branch.