repack icon indicating copy to clipboard operation
repack copied to clipboard

Remote hermes bytecode converted chunks not working.

Open singhalpranav22 opened this issue 2 years ago • 3 comments

Ask your Question

Hi, I am working with remote chunks in hermes environment. Following are the steps, i am doing:

  1. Set hermes to true app/build.gradle
  2. Made release apk with no local chunks using command ./gradlew assembleRelease. This command has been done after cleaning gradle.
  3. 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}.
  4. 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.
  5. After that i am loading, these chunks from my release APK.
  6. I get the following error message, once i load the remote hermes Chunk.
Screenshot 2022-07-06 at 8 15 06 PM 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

singhalpranav22 avatar Jul 06 '22 14:07 singhalpranav22

This looks like a bug in Re.Pack, but I'm going to investigate that to be sure.

zamotany avatar Jul 06 '22 17:07 zamotany

Thank you @zamotany !

singhalpranav22 avatar Jul 06 '22 17:07 singhalpranav22

@zamotany Hi, is there any resolution or findings?

jahglow avatar Oct 05 '22 10:10 jahglow

any news?

PhungVanHoa avatar Dec 07 '22 15:12 PhungVanHoa

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

jbroma avatar Jun 22 '23 22:06 jbroma