Closed palfaro91 closed 11 months ago
Please provide a minimal reproducible example. Doing so will help us diagnose your issue. It should be the bare minimum code needed to trigger the issue, and easily runnable without any changes or extra code.
You may use a GitHub repository to host the code if it is too much to fit in a code block (or two).
@jsumners here you go https://github.com/palfaro91/log-error/
npm install npm run dev then access the root / url and the server should crash when logging the error
[ info ] building project...
[ info ] starting http server...
Exception: E_MISSING_ENV_VALUE: Missing environment variable "APP_KEY"
at Object.<anonymous> /Users/matteo/tmp/log-error/server.ts:19
14| import sourceMapSupport from 'source-map-support'
15| import { Ignitor } from '@adonisjs/core/build/standalone'
16|
17| sourceMapSupport.install({ handleUncaughtExceptions: false })
18|
❯ 19| new Ignitor(__dirname).httpServer().start()
20|
⁃ ensureValue
/Users/matteo/tmp/log-error/node_modules/@adonisjs/env/build/src/Schema/helpers.js:26
⁃ Object.validate [as APP_KEY]
/Users/matteo/tmp/log-error/node_modules/@adonisjs/env/build/src/Schema/string.js:45
⁃ anonymous
/Users/matteo/tmp/log-error/node_modules/@adonisjs/env/build/src/Env/index.js:87
[ warn ] Underlying HTTP server died with "0 code"
[ info ] watching file system for changes
I would recommend you to provide a reproduction with just pino and axios.
@mcollina My apologies. I have added the missing file and tested it to ensure it will run.
A few notes:
The crash disappears by disabling prettyPrint because it's hitting some problematic lines that we have already fixed in latest releases of pino. Therefore, there is nothing we can do here for you.
@mcollina Alright thank you for the info. 🙏 I'll reach out to the Adonis team about getting the Pinio package updated.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hello
I'm using Adonisjs which uses PIno under the hood to log errors. I'm using axios to make some requests but I noticed that when an error is thrown and I attempt to log it it crashes the app.
node version 18.18.0 Pino version 6.14.0
Here is the stack trace given