Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use absolute file path when symbolicating HBC bundles
Summary: Changelog: [Internal] When enabling Metro with bytecode for apps like Twilight, we're seeing these type of error: ``` Error: ENOENT: no such file or directory, open 'RKJSModules/vendor/react/cjs/React-dev.js' at Object.openSync (fs.js:457:3) at Object.readFileSync (fs.js:359:35) at getCodeFrame (/Users/keo/Library/Caches/dotslash/obj/everstore/f7/GCF5agem2GP1NT0DACsCkMSaYsFCblMqAAAA/extract/tar.gz/metro/src/Server.js:1013:401) at Server._symbolicate (/Users/keo/Library/Caches/dotslash/obj/everstore/f7/GCF5agem2GP1NT0DACsCkMSaYsFCblMqAAAA/extract/tar.gz/metro/src/Server.js:1062:20) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Server._processRequest (/Users/keo/Library/Caches/dotslash/obj/everstore/f7/GCF5agem2GP1NT0DACsCkMSaYsFCblMqAAAA/extract/tar.gz/metro/src/Server.js:993:408) ``` This diff ensures we resolve the file to an absolute path and surrounds the `readFileSync` call with a try/catch to make sure we don't hit these errors. Reviewed By: cpojer Differential Revision: D25262626 fbshipit-source-id: 5d53e3ccd1942d44beb3873bf3450e7668b0dc29
- Loading branch information