repack
repack copied to clipboard
Remote hermes bytecode converted chunks not working.
Ask your Question
Hi, I am working with remote chunks in hermes environment. Following are the steps, i am doing:
- Set hermes to true app/build.gradle
- Made release apk with no local chunks using command
./gradlew assembleRelease. This command has been done after cleaning gradle. - I took my remote chunks from build/android/remote and converted them to hermes bytecode using the command:
node_modules/hermes-engine/osx-bin/hermesc ${pathToFile} -emit-binary -out ${newPath}. - I uploaded the converted JS to hermes bytecode chunks to a CDN server. API: url:
https://remotechunks-hermes.herokuapp.com/files/${chunkId}. Example chunk Id: 47. - After that i am loading, these chunks from my release APK.
- I get the following error message, once i load the remote hermes Chunk.
7. If the remote chunks are not manually converted to hermes chunks, then the app is loading those chunks fine.8. Following is my configuration for repack:
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import { ChunkManager } from '@callstack/repack/client';
ChunkManager.configure({
forceRemoteChunkResolution: false,
resolveRemoteChunk: async (chunkId) => {
return {
url: `https://remotechunks-hermes.herokuapp.com/files/${chunkId}`,
};
},
});
AppRegistry.registerComponent(appName, () => App);
@zamotany, I would be grateful, if you would help me for solving this issue. Thank You
This looks like a bug in Re.Pack, but I'm going to investigate that to be sure.
Thank you @zamotany !
@zamotany Hi, is there any resolution or findings?
any news?
While working on https://github.com/callstack/repack/pull/378 there were no issues with running remote hermes chunks on either iOS or android.
I believe this bug was fixed a while back when developing integrated tokens for CodeSigning functionality inside RemoteChunkLoader.kt:
https://github.com/callstack/repack/pull/348/files#diff-7cefd3d3476202b0dec6f15298f700114f9fd6dd2b71f5e91b527d06e403ff48
Closing this issue as it's resolved