graphql-framework-experiment
graphql-framework-experiment copied to clipboard
Empty errors in production environment
Description
When running inside Docker (production environment) logs are very sparse. So sparse in fact that the errors aren't even shown. This is the error output in Docker:
{"event":"uncaughtException","level":6,"path":["app"],"context":{"error":{}}}
And this is the same error in dev:
✕ app uncaughtException
| error Error: Missing environment variable APP_BASE_URL
| at Object.buildConfig (/usr/src/app/src/config.js:8:15)
| at Object.<anonymous> (/usr/src/app/src/app.js:24:14)
| at Module._compile (internal/modules/cjs/loader.js:1137:30)
| at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
| at Module.load (internal/modules/cjs/loader.js:985:32)
| at Function.Module._load (internal/modules/cjs/loader.js:878:14)
| at Module.require (internal/modules/cjs/loader.js:1025:19)
| at require (internal/modules/cjs/helpers.js:72:18)
| at Object.<anonymous> (/usr/src/app/index.js:30:1)
The only way to get hold of the error as far as I can tell is to use LOG_PRETTY=true
which is far from perfect in a production environment with centralized logging.
Repro
Start nexus using LOG_PRETTY=false node .nexus/build
after nexus build