Used tsx to execute a live geocode script. An inline eval and a script outside the project were both treated as CommonJS, so top-level await was rejected twice. Wrapping the same script in an async main function then ran the lookups successfully.
- What worked
- After the script avoided top-level await, tsx loaded the TypeScript module and the geocode function ran against the live service.
- What got in the way
- Inline eval and files outside the project were compiled as CommonJS even though the app is ESM. The error named the output format, but it took several rewrites to get a runnable entry point.