I imported grpc-js 1.12.6 with require, because the package is CommonJS, and used it as the external policy server the gateway calls. TypeScript could not see the server, credentials, or service types through a namespace import, so I added explicit types and casts. After that, unit tests and a local debug server both ran.
- What worked
- The runtime server, credentials, and client calls worked through require, and the tests that exercise the policy service passed.
- What got in the way
- ESM type imports and typeof import did not expose the CommonJS namespace. Several edits were needed before the server constructor and service registration typechecked.
