Skip to content

Fix react-native build with hermes enabled on Windows#811

Merged
anywherepilot merged 2 commits intomicrosoft:masterfrom
Shywim:fix-codepush-hermes-windows
Apr 21, 2020
Merged

Fix react-native build with hermes enabled on Windows#811
anywherepilot merged 2 commits intomicrosoft:masterfrom
Shywim:fix-codepush-hermes-windows

Conversation

@Shywim
Copy link
Contributor

@Shywim Shywim commented Apr 17, 2020

This should fixes #693.

For now, we can't deploy a react-native release on Windows with hermes enabled because the script looks for an executable file without a .exe file extension, whereas on Windows, we need a .exe extension, throwing an ENOENT error.

image

Full error:

Error: spawn node_modules\hermesvm\win64-bin\hermes ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn node_modules\\hermesvm\\win64-bin\\hermes',
  path: 'node_modules\\hermesvm\\win64-bin\\hermes',
  spawnargs: [
    '-emit-binary',
    '-out',
    'C:\\Users\\shywi\\AppData\\Local\\Temp\\code-push2020317-23456-1rdxgc2.ndt9\\CodePush\\index.android.bundle.hbc',      'C:\\Users\\shywi\\AppData\\Local\\Temp\\code-push2020317-23456-1rdxgc2.ndt9\\CodePush\\index.android.bundle',          '-w'
  ]
}

This PR add a function to look for platform specific executable file extension.

@anywherepilot
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Shywim Shywim requested a review from anywherepilot April 20, 2020 10:04
@anywherepilot
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@anywherepilot
Copy link
Contributor

Thank you very much for figuring out the problem and solving it @Shywim. I agree this solves #693. We'll release a new version with this code so you and everyone can benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"release-react" fails when using RN 0.61+ with Hermes enabled

2 participants

Comments