Mdx-deck: Dev server failing with res.getHeader is not a function

Created on 7 Mar 2019  路  8Comments  路  Source: jxnblk/mdx-deck

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

Most helpful comment

@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.

All 8 comments

@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.

@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.

Works with adding "webpack-dev-middleware": "3.6.0" to my dependencies and running rm -rf node_modules && npm i.

Thanks @arthyn and @federico-hv for the quick assistance.

Would leave this open for now to track the issue for others running into it.

faced the same issue. Solution suggested by @arthyn worked.

Has anyone tried with the v2 beta? Would be good to know if the changes there resolve this issue

I think this issue was only caused by the dependency on koa-webpack and apparently the issue there was solved cause now everything works fine on the version I was using of this library 1.10.0 without the change on webpack-dev-middleware. Also tried last version 2.0.0-11 and everything works fine. Thank you very much @jxnblk

Can also confirm that with 2.0.0-11 the issue does not occur anymore.

Just did a clean install with version 2.0.0 and couldn't see the bug anymore.

I will consider this resolved, thanks again to all involved 馃檪

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jxnblk picture jxnblk  路  4Comments

zz1211 picture zz1211  路  7Comments

busypeoples picture busypeoples  路  5Comments

codepunkt picture codepunkt  路  5Comments

marcysutton picture marcysutton  路  4Comments