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

Spdy net::ERR_CONTENT_DECODING_FAILED 200 #1699

Closed
1 of 2 tasks
yadue opened this issue Mar 5, 2019 · 7 comments
Closed
1 of 2 tasks

Spdy net::ERR_CONTENT_DECODING_FAILED 200 #1699

yadue opened this issue Mar 5, 2019 · 7 comments

Comments

@yadue
Copy link

yadue commented Mar 5, 2019

  • Operating System: Mac OS
  • Node Version: 8.11.4
  • NPM Version: 5.6.0
  • webpack Version:
  • webpack-dev-server Version: 3.2.1
  • This is a bug
  • This is a modification request

Code

Angular CLI with proxy:

When using dev-server with https proxy with config:

{
  "/api": {
    "target": "https://***.localhost:8443",
    "secure": false,
    "hostRewrite": true,
    "autoRewrite": true,
    "ws": true
  }
}

I'm getting error when trying to data via ajax call:
net::ERR_CONTENT_DECODING_FAILED 200

I went through different versions of webpack dev server and its related to release
3.10.0 -> 3.11.0, when the spdy version has been updated from 3.4.0 to 4.0.0.
I reverted those changes locally and everything started to work fine (just spdy version)

When forced Server.js to use only https.createServer(options.https, app);
all went good. When using:
require('spdy').createServer(options.https, app);

it returns error described. It could be awesome if you could tell me whats going on or maybe
introduce an option in dev server to disable spdy dev server if it fails so often.

Expected Behavior

requests should work just fine or option to disable spdy completly

Actual Behavior

net::ERR_CONTENT_DECODING_FAILED 200

For Bugs; How can we reproduce the behavior?

Not sure if it's reproducible, but I'm using angular 7.2.7 with proxy settings

@alexander-akait
Copy link
Member

We need reproducible test repo, it is hard to debug and search problem without example

@yadue
Copy link
Author

yadue commented Mar 5, 2019

I tried to reproduce this with express js but with no luck, but at the end I found out that:

  • with proxy to spring boot server, https, gzip
    net::ERR_CONTENT_DECODING_FAILED 200
    https://imgur.com/h0JSywp
  • with proxy to spring boot server, https no gzip
    Unexpected token , in JSON at position 8192 at JSON.parse and really missing some characters in that positions
  • with proxy to express, https gzip - 200, ok
    https://imgur.com/tTq9heQ
  • with proxy to express, https, no gzip - 200, ok
  • without proxy, spring boot server, https gzip - 200, ok
    https://imgur.com/sM9HZSC
  • without proxy, spring boot server, https, no gzip - 200, ok

Maybe you'll have some idea what could be wrong but that broken json at 8192~ish position is the key.

@alexander-akait
Copy link
Member

with proxy to spring boot server, https no gzip
Unexpected token , in JSON at position 8192 at JSON.parse and really missing some characters in that positions

Maybe related #1574 ? And problem with net::ERR_CONTENT_DECODING_FAILED 200 looks also related to this issue.

@yadue
Copy link
Author

yadue commented Mar 5, 2019

Yeah, it sounds it’s related, but in my particular case it breaks after 8192 signs, and it worked just fine when using the same json response from express js, same response coming from spring boot didn’t.

@alexander-akait
Copy link
Member

Wait reproducible test repo, it is really hard to debug and find problem without this

@yadue
Copy link
Author

yadue commented Mar 6, 2019

here you go:
https://github.com/yadue/webpack-dev-server-proxy-issue
npm install
npm run start
open https://app.localhost:4201/
you'll see 2 requests proxied to
http://yadue.synology.me/api3/2jcegul7ephjg2emsfg4v5097g.json (10kb)
http://yadue.synology.me/api3/2jcegul7ephjg2emsfg4v5097g-small.json (2kb)
https://imgur.com/a/sXfyiuY

it really took me so long to find reproducible case.

@alexander-akait
Copy link
Member

Close in favor #1574

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

2 participants