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

fix(diff-snapshot): Fix stringify failure due to circular referneces. #72

Merged
merged 6 commits into from
Apr 24, 2018

Conversation

skywhale
Copy link
Contributor

Since node 9, PNG._packer._handle.jsref has a circular reference, causing JSON.stringify to fail. Since none of the hidden properties starting with _ aren't needed for writing the images, I went ahead and discarded them all.

@CLAassistant
Copy link

CLAassistant commented Apr 16, 2018

CLA assistant check
All committers have signed the CLA.

@anescobar1991
Copy link
Member

@skywhale does this solve the node 9 compatibility issues? I thought the issue was with the pngjs package 🤔

If this solves them then can you modify the travis config to add node 9 so that we know before this PR is merged if that is truly the case and so we don't suffer from any regressions on 9?

@skywhale
Copy link
Contributor Author

@anescobar1991

There are two separate issues, one in pngjs, and another in jest-image-snapshot. I merged pngjs/pngjs#108 to my local repo, and started seeing this TypeError due to a circular ref introduced in PNG. Both PRs need to land.

@skywhale
Copy link
Contributor Author

@anescobar1991 Added v9 to travis config. Let me get back to this PR after pngjs/pngjs#110 is merged.

@anescobar1991
Copy link
Member

@skywhale thanks!

@anescobar1991
Copy link
Member

anescobar1991 commented Apr 19, 2018

I wonder why the tests passed on node 9 though? I know the integration tests were failing for me on node 9 before.

Edit: never mind I see that it is because you have it referencing the branch with the bugfix

@anescobar1991
Copy link
Member

or because pngjs is fixed now! 🎆

package.json Outdated
@@ -55,7 +55,7 @@
"lodash": "^4.17.4",
"mkdirp": "^0.5.1",
"pixelmatch": "^4.0.2",
"pngjs": "^3.3.0",
"pngjs": "https://github.com/skywhale/pngjs/archive/fixnode9.tar.gz",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this back and it should work now!

Copy link
Member

@10xLaCroixDrinker 10xLaCroixDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skywhale LGTM, can you squash your commits? (squashed on merge)

@dan-kez
Copy link

dan-kez commented Apr 24, 2018

Awesome! Any chance we can cut a new version to npm with this change?

@anescobar1991
Copy link
Member

@dmk255 done! v2.4.1 includes these changes

skywhale added a commit to skywhale/storybook that referenced this pull request Apr 29, 2018
goverdhan07 pushed a commit to goverdhan07/jest-image-snapshot that referenced this pull request Jul 23, 2023
…mericanexpress#72)

* fix(diff-snapshot): Fix stringify failure due to circular referneces.

* fix(diff-snapshot): Apply tslint --fix

* Add node v9 to CI build

* DO NOT SUBMIT: Fix pngjs.

* Remove comment.

* Upgrade pngjs to 3.3.3
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.

5 participants