You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We ran into the same (?) issue on Node v22.3.0 with tslog 4.9.3 (also via pnpm), also reading a fetch Response object (so stacktrace goes like formatWithOptions, inspect, formatValuie, [nodejs.util.inspect.custom] in undici, then get status).
(Also note that regarding the opening bug report undici has this warning: The body returned from undici.request does not implement .formData().)
Though it seems the root cause is likely that tslog does not handle errors during formatting of the log line. :/
Describe the bug
I'm getting below error when I log as below
const reqBody = await event.request.formData();
log.info(reqBody)
event is https://kit.svelte.dev/docs/types#public-types-requestevent.
but it works fine if I do log.info(JSON.stringify(reqBody))
TypeError Cannot read properties of undefined (reading 'reduce')
error stack:
• undici [nodejs.util.inspect.custom]
internal/deps/undici/undici:4887
• inspect formatValue
internal/util/inspect:806
• inspect inspect
internal/util/inspect:365
• inspect formatWithOptionsInternal
internal/util/inspect:2304
• inspect formatWithOptions
internal/util/inspect:2166
• index.js Object.transportFormatted
/node_modules/.pnpm/[email protected]/node_modules/tslog/dist/esm/runtime/nodejs/index.js:107
• BaseLogger.js Logger.log
/node_modules/.pnpm/[email protected]/node_modules/tslog/dist/esm/BaseLogger.js:101
• index.js Logger.info
/node_modules/.pnpm/[email protected]/node_modules/tslog/dist/esm/index.js:26
•
• task_queues process.processTicksAndRejections
internal/process/task_queues:95
Screenshots
![image](https://private-user-images.githubusercontent.com/20642737/353313868-61c77ad7-c276-4b0d-826b-64aa64662308.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODkwMzksIm5iZiI6MTczOTI4ODczOSwicGF0aCI6Ii8yMDY0MjczNy8zNTMzMTM4NjgtNjFjNzdhZDctYzI3Ni00YjBkLTgyNmItNjRhYTY0NjYyMzA4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE1NDUzOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU1NDRlYTNjOTc2Mzk4NTQzNjA0YTI0OGQ0MmMwZDlkNGFjZjIzZjI1ZDVmZDFjY2NkNDExYzk1M2YxNmI3ZmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.kL0Fu7m8goCVoA_q-o5nw8_mjSao3nHRp_Mqk-wFK1o)
Additional context
Add any other context about the problem here.
Node.js Version
v20.16.0
Same issue with Bun 1.1.21 as well.
OS incl. Version
Ubuntu 24.04 LTS 6.8.0-39-generic
The text was updated successfully, but these errors were encountered: