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

parseJSON hook doesn't work in Chrome 43 #268

Closed
taion opened this Issue Apr 7, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@taion
Member

taion commented Apr 7, 2015

Specifically on this line: https://github.com/jhollingworth/marty/blob/d516e9713a2ce36ba3270dac5918c438ca421d1f/lib/stateSource/inbuilt/http/hooks/parseJSON.js#L10

It fails with an error like: Uncaught (in promise) TypeError: Cannot set property body of #<Response> which has only a getter.

Because Response.body actually is a property with only a getter. You could replace that line with something like

Object.defineProperty(res, 'body', {value: body});

That gets things working again, but it's probably not ideal to try to re-define body on the Response.

@jhollingworth jhollingworth added the bug label Apr 7, 2015

@jhollingworth

This comment has been minimized.

Show comment
Hide comment
@jhollingworth

jhollingworth Apr 7, 2015

Contributor

damn! thats very annoying. I think we're going to have to remove this. Question is, to me this is a breaking change so should go in v0.10 but at the same time its a bug that should be fixed in v0.9.... What do you think?

Contributor

jhollingworth commented Apr 7, 2015

damn! thats very annoying. I think we're going to have to remove this. Question is, to me this is a breaking change so should go in v0.10 but at the same time its a bug that should be fixed in v0.9.... What do you think?

@taion

This comment has been minimized.

Show comment
Hide comment
@taion

taion Apr 7, 2015

Member

I think the bugfix for 0.9 could be to just use the Object.defineProperty hack (maybe only if necessary?). This keeps existing code working, but assuming things don't change before the Chrome release rolls forward, users will have to upgrade Marty to keep things working.

Member

taion commented Apr 7, 2015

I think the bugfix for 0.9 could be to just use the Object.defineProperty hack (maybe only if necessary?). This keeps existing code working, but assuming things don't change before the Chrome release rolls forward, users will have to upgrade Marty to keep things working.

@jhollingworth

This comment has been minimized.

Show comment
Hide comment
@jhollingworth

jhollingworth Apr 8, 2015

Contributor

Released in v0.9.9

Contributor

jhollingworth commented Apr 8, 2015

Released in v0.9.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment