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

Works differently in browser and nodejs #62

Open
Maqsim opened this issue Jan 24, 2018 · 8 comments
Open

Works differently in browser and nodejs #62

Maqsim opened this issue Jan 24, 2018 · 8 comments

Comments

@Maqsim
Copy link

Maqsim commented Jan 24, 2018

{"watermark":{"position":[74,-3],"colorMode":"white","enabled":true},"subtitles":{"color":"#000000","enabled":false},"audiowave":{"size":10,"backgroundEnabled":false,"backgroundOpacity":20,"backgroundColor":"#000000","color":"#ffffff","enabled":true},"caption":{"text":"013.mp3","position":[4,8],"backgroundEnabled":true,"backgroundOpacity":36,"backgroundColor":"#000000","fontSize":40,"color":"#ffffff","enabled":true},"background":{"imageUrls":[],"enabled":false}}
===
{"watermark":{"position":[74,-3],"colorMode":"white","enabled":true},"subtitles":{"color":"#000000","enabled":false},"audiowave":{"size":10,"backgroundEnabled":false,"backgroundOpacity":20,"backgroundColor":"#000000","color":"#ffffff","enabled":true},"caption":{"text":"013.mp3","position":[4,8],"backgroundEnabled":true,"backgroundOpacity":36,"backgroundColor":"#000000","fontSize":40,"color":"#ffffff","enabled":true},"background":{"imageUrls":[],"enabled":false}}
4c44ffc6628dcedb7ee8e7c6c27c00853fcca251
!==
e7cdcdc4fad9a0e1db0517c6757236ebf1867f41
@cvimbert
Copy link

cvimbert commented Mar 8, 2018

My problem is similar :
The hash is different in Angular environment, and angular-free environment.

@pavelthq
Copy link

pavelthq commented Apr 25, 2018

Just checked on chrome and node works correct - e7cdcdc4fad9a0e1db0517c6757236ebf1867f41

@imhazige
Copy link

I have the same problem, when using react, it is same, when client use vue, they are different.

@cloverich
Copy link

Curious that it would be different per Angular or Vue. Does those frameworks wrap objects in observables (or something similar)? What happens if you JSON.parse(JSON.stringify(obj)) before doing the hash?

@imhazige
Copy link

we can not reproduce the problem again now, the problem happened months ago. we will let you know if we encountered it again. Thanks.

@Maqsim
Copy link
Author

Maqsim commented Jan 21, 2019

Cool. Thanks guys

@coderroggie
Copy link

I had a similar issue where angular !== node. I'm using typescript in both environments. Adding respectType: false to the hash options fixed my issue.

@Chnapy
Copy link

Chnapy commented Apr 13, 2020

I have the same issue between my front & back.

I tried using respectType: false without success.
But it works with JSON.parse(JSON.stringify(obj)) like suggested @cloverich , hashes are the same.

I suspect the cause to be ES6 getters (get props()) that are present in a side but not in the other one.

This is the object I try to hash (JSON): https://pastebin.com/q1TbrwHA

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

No branches or pull requests

7 participants