question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dev server failing with res.getHeader is not a function

See original GitHub issue

Wanting to try out mdx-deck as an awesome Markdown based presentations tool I followed the quick start in the readme using mdx-deck v1.10.0.

I have a simple deck.mdx with my slides ad want to run that with "start": "mdx-deck deck.mdx" in my npm scripts.

What happens

My browser opens a new tab at http://127.0.0.1:8080/ which keeps on loading forever without ever finishing. (waited five+ minutes) The same happens when i visit http://localhost:8080/ in my browser.

What I would expect

I would expect to see the presentation display in my browser.

Further observations

Using the mdx-deck build script works just fine.

When I Ctrl + C out of the process it shows the following error: TypeError: res.getHeader is not a function, or more fully:

TypeError: res.getHeader is not a function
    at processRequest (/Users/X/stuff/talks/my-presentation-name/node_modules/webpack-dev-middleware/lib/middleware.js:82:18)
    at ready (/Users/X/stuff/talks/my-presentation-name/node_modules/webpack-dev-middleware/lib/util.js:51:12)
    at handleRequest (/Users/X/stuff/talks/my-presentation-name/node_modules/webpack-dev-middleware/lib/util.js:167:5)
    at Promise (/Users/X/stuff/talks/my-presentation-name/node_modules/webpack-dev-middleware/lib/middleware.js:44:7)
    at new Promise (<anonymous>)
    at middleware (/Users/X/stuff/talks/my-presentation-name/node_modules/webpack-dev-middleware/lib/middleware.js:43:12)
    at Promise (/Users/X/stuff/talks/my-presentation-name/node_modules/koa-webpack/lib/middleware.js:28:9)
    at new Promise (<anonymous>)
    at /Users/X/stuff/talks/my-presentation-name/node_modules/koa-webpack/lib/middleware.js:27:20
    at dispatch (/Users/X/stuff/talks/my-presentation-name/node_modules/koa-compose/index.js:42:32)

I pushed the example that is not working for me here: https://github.com/HoverBaum/mdx-deck-bug-illustration-dev-server

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
federico-hvcommented, Mar 7, 2019

@HoverBaum I was having this same issue. Just removed node_modules, added "webpack-dev-middleware": "3.6.0" as suggested by @arthyn, run npm install and now it is working fine.

2reactions
arthyncommented, Mar 7, 2019

@HoverBaum It seems a change going from webpack-dev-middleware 3.6.0 to 3.6.1 caused koa-webpack to break. If you downgrade you should be able to get back up and running until it’s fixed there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: request.getHeader is not a function - Stack Overflow
Your req.getHeader() is not working because there is no method inside the incoming http message object. You are getting an http.
Read more >
Why request.getHeader doesn't work on request object on ...
but, when using ClientRequest for handling incoming requests in a NodeJS server, using getHeader() does not work, returning the error function ...
Read more >
Errors | Node.js v19.3.0 Documentation
For all EventEmitter objects, if an 'error' event handler is not provided, the error will be thrown, causing the Node.js process to report...
Read more >
HTTP | Node.js v18 API
When a connection is closed by the client or the server, it is removed from the pool. Any unused sockets in the pool...
Read more >
Node.js HTTP: ERR_HTTP_HEADERS_SENT - Airbrake Blog
Your server may be trying several times to reach a client and failing because it can't find the header. The fix for this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found