Skip to content

Response.getHeader may be undefined, not a function #380

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

Closed
1 task done
sjy opened this issue Mar 7, 2019 · 17 comments
Closed
1 task done

Response.getHeader may be undefined, not a function #380

sjy opened this issue Mar 7, 2019 · 17 comments

Comments

@sjy
Copy link

sjy commented Mar 7, 2019

  • Operating System: OSX
  • Node Version: 10.15.1
  • NPM Version: 6.4.1
  • webpack version: 4.1.6
  • webpack-dev-middleware Version: 3.6.1
  • This is a bug

Expected Behavior

No error

Actual Behavior

A TypeError throwed

 if (!res.getHeader('Content-Type')) {
...
}

image

For Bugs; How can we reproduce the behavior?

Use vue-cli create a app and install the latest version of webpack-dev-middleware

@sjy
Copy link
Author

sjy commented Mar 7, 2019

#377 introduce this issue

@sjy
Copy link
Author

sjy commented Mar 7, 2019

@evilebottnawi should i need to make a pr which will check getHeader before call it

hubcarl pushed a commit to easy-team/webpack-tool that referenced this issue Mar 7, 2019
@alexander-akait
Copy link
Member

@sjy yep, feel free to send a PR, anyway what is use case where getHeader is undefined?

@sjy
Copy link
Author

sjy commented Mar 7, 2019

My project depends on koa-webpack, shellscape/koa-webpack#109

@alexander-akait
Copy link
Member

@sjy we don't support officially koa, we can add check, but in future it can get other broken part

@dmohns
Copy link
Contributor

dmohns commented Mar 7, 2019

Looks like help is on the way: shellscape/koa-webpack#110

@nuintun
Copy link
Contributor

nuintun commented Mar 8, 2019

Same problem !!

@wssgcg1213
Copy link

same problem.

@weipxiu

This comment has been minimized.

@davinma

This comment has been minimized.

@alexander-akait
Copy link
Member

All comments are not in English are marked as spam.

@alexander-akait
Copy link
Member

Update your deps

@white87332
Copy link

same problem!!

@alexander-akait
Copy link
Member

Update your deps

@emilsedgh
Copy link

emilsedgh commented Mar 24, 2019

Which dependency must be updated to resolve this?

It seems that koa-webpack is the package which included the fix but I'm not even using that.

Do I have to?

@jqueryisamonad
Copy link

@emilsedgh are you sure about that? Is the grep koa-webpack package-lock.json output empty?

@emilsedgh
Copy link

Yes I'm quite sure of that.

It seems that koa-webpack wrapped webpack-dev-middleware and webpack-hot-client, which were already set up.

I'm in the process of porting to koa-webpack anyways, but I think this bugs means people wont be able to opt-out of that anymore.

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

No branches or pull requests

10 participants