Page MenuHomePhabricator

[keyserver] Update importJSON to use fs instead of import
ClosedPublic

Authored by rohan on Sep 29 2022, 12:44 PM.
Tags
None
Referenced Files
F3248337: D5267.id17247.diff
Fri, Nov 15, 9:26 AM
Unknown Object (File)
Fri, Nov 8, 6:07 AM
Unknown Object (File)
Fri, Nov 8, 5:24 AM
Unknown Object (File)
Tue, Nov 5, 9:45 AM
Unknown Object (File)
Tue, Nov 5, 9:45 AM
Unknown Object (File)
Tue, Nov 5, 9:45 AM
Unknown Object (File)
Tue, Nov 5, 9:44 AM
Unknown Object (File)
Tue, Nov 5, 9:43 AM
Subscribers

Details

Summary

Replace the await import(../../${path}) syntax in importJSON to
use fs.readFileSync instead.

This addresses: https://linear.app/comm/issue/ENG-1182/update-importjson-to-use-fs-instead-of-import

Context: https://linear.app/comm/issue/ENG-929/fix-issues-with-node-1614-import-syntax-assertions

Test Plan

The local instance of Comm remains running and does not crash
with these new changes. Also ran flow in the keyserver directory to
ensure that it was fine to remove the $FlowFixMe comment.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Looks good, but before landing can you include a console.log with a descriptive error message in the catch block?

This revision is now accepted and ready to land.Sep 30 2022, 6:11 AM

Add a descriptive console.log message when catching an error