Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogCollectBrowserConsole serialization issue #192

Closed
ming-codes opened this issue Jun 28, 2023 · 3 comments
Closed

LogCollectBrowserConsole serialization issue #192

ming-codes opened this issue Jun 28, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ming-codes
Copy link

tests?p=cypress/support/e2e.ts:40561 TypeError: Cannot convert object to primitive value
    at processArg (tests?p=cypress/support/e2e.ts:40546:36)
    at Array.map (<anonymous>)
    at appWindow.console.<computed> [as warn] (tests?p=cypress/support/e2e.ts:40560:53)

The error is stem from this line, where it caught an error but try to serialize it again by attempting to concatenate it.

return '[unprocessable=' + arg + ']';

The other issue is already described by #191, but it is actually more generic. JSON.stringify can throw simply on object that's too big.

@archfz archfz added the bug Something isn't working label Jun 28, 2023
@archfz
Copy link
Owner

archfz commented Jun 28, 2023

I was thinking on using https://www.npmjs.com/package/safe-json-stringify but maybw this case would not be covered still.

@ming-codes
Copy link
Author

You think we can add an option for maximum depth to serialize? We can include a good default.

@archfz
Copy link
Owner

archfz commented Jul 3, 2023

Should be fixed in 5.3.0

@archfz archfz closed this as completed Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants