Skip to content

fix cannot convert object to primitive value#335

Closed
nusr wants to merge 1 commit into
fullstack-build:masterfrom
nusr:master
Closed

fix cannot convert object to primitive value#335
nusr wants to merge 1 commit into
fullstack-build:masterfrom
nusr:master

Conversation

@nusr

@nusr nusr commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

fix #329

Uncaught (in promise) TypeError: Cannot convert object to primitive value
    at String (<anonymous>)
    at BaseLogger.js:205:25
    at Array.reduce (<anonymous>)
    at formatErrorMessage (BaseLogger.js:200:14)
    at Object.prettyFormatErrorObj (BaseLogger.js:67:31)
    at maskedArgs.reduce.args (BaseLogger.js:50:52)
    at Array.reduce (<anonymous>)
    at Object.prettyFormatLogObj (BaseLogger.js:48:31)
    at CustomerLogger.log (BaseLogger.js:649:72)
    at CustomerLogger.error (index.js:32:22)

@terehov

terehov commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Thank you very much. Will land in the coming release

terehov pushed a commit that referenced this pull request Jun 27, 2026
Route error property values through stringifyFallback so logging an
error whose property is a null-prototype object or has a throwing
toString/Symbol.toPrimitive no longer crashes formatting.
terehov added a commit that referenced this pull request Jun 27, 2026
Route error property values through stringifyFallback so logging an
error whose property is a null-prototype object or has a throwing
toString/Symbol.toPrimitive no longer crashes formatting.
@terehov

terehov commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Thank you, @nusr! The Cannot convert object to primitive value crash is fixed in 4.11.0 — logging an error whose property is a null-prototype object or has a throwing toString/Symbol.toPrimitive no longer crashes formatting (changelog credits #335/#294, fixing #329). Closing as released.

— Eugene

@terehov terehov closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Question: Is it possible to overwrite formatErrorMessage?

2 participants