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

Error when printing an object to the dev tools console #18143

Closed
bahmutov opened this issue Sep 17, 2021 · 3 comments · Fixed by #18341
Closed

Error when printing an object to the dev tools console #18143

bahmutov opened this issue Sep 17, 2021 · 3 comments · Fixed by #18341

Comments

@bahmutov
Copy link
Contributor

Current behavior

When clicking on the graphql mutation call getting an error and nothing is printed

Screen Shot 2021-09-17 at 10 33 37

Desired behavior

No response

Test code to reproduce

print.mp4

Cypress Version

8.4.0

Other

No response

@jennifer-shehane jennifer-shehane added type: bug stage: ready for work The issue is reproducible and in scope labels Sep 17, 2021
@cbolgiano
Copy link
Contributor

I can take a look at this issue.

@cbolgiano
Copy link
Contributor

cbolgiano commented Oct 2, 2021

This looks to be due to how lodash handles objects in https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/.internal/baseToString.js#L29. The version of the function in the 4.17.21 tag looks like this https://github.com/lodash/lodash/blob/4.17.21/dist/lodash.js#L4298. Line 4298 is what we see in the video captured in this issue.

I am going to try to fix this by making a change in this function:

_logValues (consoleProps) {
to convert value if it is an object that isn't null and not an array to a string before trim is called.

@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope stage: work in progress stage: needs review The PR code is done & tested, needs review labels Oct 2, 2021
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: waiting labels Oct 11, 2021
@jennifer-shehane
Copy link
Member

Released in 8.6.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v8.6.0, please open a new issue.

@cypress-io cypress-io locked and limited conversation to collaborators Oct 27, 2021
@jennifer-shehane jennifer-shehane removed the stage: needs review The PR code is done & tested, needs review label Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants