-
Notifications
You must be signed in to change notification settings - Fork 4.7k
vuepress dev: throws res.getHeader() is not a function #1417
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
Comments
https://github.com/webpack/webpack-dev-middleware/blob/master/lib/middleware.js#L82
|
how to resolve this problem? |
@ing670 I've never used vuepress before ... but I think the solution for this bug in on the way as part of a fix to |
got the same problem just now Version
output below is the centos 7 version DONE [11:57:48] Build 636cc5 finished in 23670 ms!
> VuePress dev server listening at http://localhost:8082/
(node:18856) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
at processRequest (/root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/middleware.js:82:18)
at ready (/root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/util.js:51:12)
at handleRequest (/root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/util.js:167:5)
at Promise (/root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/middleware.js:44:7)
at new Promise (<anonymous>)
at middleware (/root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/middleware.js:43:12)
at Promise.all.Promise (/root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/koa-webpack/index.js:43:7)
at new Promise (<anonymous>)
at /root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/koa-webpack/index.js:42:5
at dispatch (/root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/koa/node_modules/koa-compose/index.js:42:32)
at /root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/@shellscape/koa-static/legacy/index.js:58:19
at Generator.throw (<anonymous>)
at step (/root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/@shellscape/koa-static/legacy/index.js:6:221)
at _throw (/root/.nvm/versions/node/v8.12.0/lib/node_modules/vuepress/node_modules/@shellscape/koa-static/legacy/index.js:6:455)
at <anonymous>
(node:18856) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:18856) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
and this is macos version DONE [20:04:45] Build 4211fb finished in 3279 ms!
> VuePress dev server listening at http://localhost:8080/
(node:23109) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: res.getHeader is not a function
(node:23109) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. |
got the same problem just now |
The dependency chain is "resolutions": {
"webpack-dev-middleware": "3.6.0"
} While the npm user can re-install npm install webpack-dev-middleware@3.6.0 When |
I'm also experiencing this. This is the first time ever that I've searched a repo and actually found my exact same problem! I'm sorry for the newbie question, but how do I go about implementing @ulivz's fix? I installed VuePress the recommended way by typing My question is which file should I edit to add the resolutions mentioned above? I'm not seeing a package.json file be generated in the directory where I ran |
@edadams Since @ulivz has found the exact module that caused the issue, you can override that module version in your What you want to do is to edit your
And run |
@abrahamdio Thank you! I ended up giving up, I'll just wait for the dependency to get updated. I don't have a |
@edadams Feel free to contact me if you need further help with general installation, and we can take it somewhere else since its no longer relevant to this thread anymore. |
How to deal with the error |
Recommend actually reading this thread. There are several solutions.
…On Mon, Mar 11, 2019 at 1:16 AM fanmucc ***@***.***> wrote:
> VuePress dev server listening at http://localhost:8081/
(node:50091 <http://localhost:8081/(node:50091>) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
at processRequest (/Users/fanmu/Desktop/Learning_blog/node_modules/webpack-dev-middleware/lib/middleware.js:82:18)
at ready (/Users/fanmu/Desktop/Learning_blog/node_modules/webpack-dev-middleware/lib/util.js:51:12)
at handleRequest (/Users/fanmu/Desktop/Learning_blog/node_modules/webpack-dev-middleware/lib/util.js:167:5)
at Promise (/Users/fanmu/Desktop/Learning_blog/node_modules/webpack-dev-middleware/lib/middleware.js:44:7)
at new Promise (<anonymous>)
at middleware (/Users/fanmu/Desktop/Learning_blog/node_modules/webpack-dev-middleware/lib/middleware.js:43:12)
at Promise.all.Promise (/Users/fanmu/Desktop/Learning_blog/node_modules/koa-webpack/index.js:43:7)
at new Promise (<anonymous>)
at /Users/fanmu/Desktop/Learning_blog/node_modules/koa-webpack/index.js:42:5
at dispatch (/Users/fanmu/Desktop/Learning_blog/node_modules/koa/node_modules/koa-compose/index.js:42:32)
at ***@***.***/koa-static/legacy/index.js:58:19
at Generator.throw (<anonymous>)
at step ***@***.***/koa-static/legacy/index.js:6:221)
at _throw ***@***.***/koa-static/legacy/index.js:6:455)
(node:50091) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:50091) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
How to deal with the error
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1417 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAu-2kRSjQpWwaq4tAIR76uOkHLMPnZgks5vVa5dgaJpZM4bkbSW>
.
|
the problem has been solved |
I'm still getting this with webpack-dev-middleware at 3.6.0 |
I can confirm that simply adding this to
and then reinstalling dependencies with |
I'm still having issues @ekhall is.
{
...
"scripts": {
"start": "vuepress dev"
},
...
"dependencies": {
"vuepress": "^0.14.10",
"webpack-dev-middleware": "^3.6.0"
},
"devDependencies": {
"eslint": "^5.15.1",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.16.0"
}
} I've tried EDIT ✨ I actually got it working ✨ My I did {
...
"scripts": {
"start": "vuepress dev"
},
...
"dependencies": {
"vuepress": "^0.14.10"
},
"resolutions": {
"webpack-dev-middleware": "3.6.0"
},
"devDependencies": {
"eslint": "^5.15.1",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.16.0"
}
} Then you'll run it locally (as the |
Bumps the vuepress dependency to version 0.14.10 to fix the missing sidebar btton on a mobile homepage issue. This version introduces a bug when running the development server but is temporarily fixed by adding webpack-dev-middleware@3.6.0 as a devDependency. See: - vuejs/vuepress#1355 - vuejs/vuepress#1417
I tried to remove |
removed vuepress using npm uninstall -g vuepress, installed it using yarn. but still getting the same problem.... Its getting the webpack-dev-middleware from AppData still should i do anything else to use the one from the node_modules of the project folder? DONE [08:53:57] Build 9aff89 finished in 396 ms! (http://localhost:8080/Eguru/wiki/)
(node:13824) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
at processRequest (C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\webpack-dev-middleware\lib\middleware.js:82:18)
at ready (C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\webpack-dev-middleware\lib\util.js:51:12)
at handleRequest (C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\webpack-dev-middleware\lib\util.js:167:5)
at Promise (C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\webpack-dev-middleware\lib\middleware.js:44:7)
at new Promise (<anonymous>)
at middleware (C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\webpack-dev-middleware\lib\middleware.js:43:12)
at Promise.all.Promise (C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\koa-webpack\index.js:43:7)
at new Promise (<anonymous>)
at C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\koa-webpack\index.js:42:5
at dispatch (C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\koa\node_modules\koa-compose\index.js:42:32)
at C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\@shellscape\koa-static\legacy\index.js:58:19
at Generator.throw (<anonymous>)
at step (C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\@shellscape\koa-static\legacy\index.js:6:221)
at _throw (C:\Users\rafae\AppData\Local\Yarn\Data\global\node_modules\@shellscape\koa-static\legacy\index.js:6:455)
(node:13824) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13824) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. EDIT Got it running using yarn docs:dev instead of vuepress dev should i reconfigure something to run using yarn? |
I was able to fix this as per @Morgul 's description above however it was important to note that I needed to run the local copy of vuepress via the yarn scripts on the installation page (yarn docs:dev, etc) and not via the global vuepress installation. |
I'm working at: {
"name": "testvuepress",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"vuepress": "^0.14.10"
},
"devDependencies": {
"eslint": "^5.15.1",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.16.0",
"webpack-dev-middleware": "^3.6.0"
}
} |
Also getting this problem with a fresh install of the global CLI (via npm) running |
@bnb Assuming you're using yarn, add this to your
and If you're using npm,
and run These solutions will install a new local dependency of |
Can a temporary solution for the globally installed VuePress be to published a version with a pinned |
采坑+1
解决方法: 删除 node_modules, 使用yarn 重新安装依赖。
|
why don't use 1.x ? |
因為 1.x 目前還在 Alpha 階段,配置可能會不斷修改,為了避免重複修改用穩定版可能比較好 roadmap 說 1.x 預計六月釋出,現在算穩定了嗎?如果足夠成熟我也想盡快升級到 1.x Since 1.x is still in Alpha now, the features might change in the near future. I preferred to use stable release instead. |
一直听闻vuepress. 今天决定试玩一下, hello world跑不成功, google至此,期待尽快解决。 My first try of vuepress redirected me here (手动滑稽) |
I have been using it now.And feeling very stable. |
Wow cool! I'll take a shot. Thanks |
NOTE: workaround of vuepress issue: vuejs/vuepress#1417
mac 10.13.6 |
Is vuepress still actively maintained? would love to help if not |
That's a weird question. What would give you the impression it isn't? In the last 17 days over 25 PRs were merged. There's commits like every other day. |
env:ubuntu 18.04 LTS
and then:
|
* 📌 dependency: add resolutions NOTE: workaround of vuepress issue: vuejs/vuepress#1417 * 📦 build(vuepress): generate docs * 📦 build(dist): generate dist files * 🎉 release(minor): v8.10.0 * 📝 docs(vuepress): update scoped style docs (kazupon#546) by @kenanchristian * 📝 docs(vuepress): fix typo in i18n-n functional component (kazupon#549) by @blowsie
I've done the same on Windows: in a basic yarn installation, go to 'C:\Users\Username\AppData\Local\Yarn\Data\global\node_modules' and just run: |
thank U for solved my problem MacOS: 10.14.4 |
Thank you very much! |
Fixed at webpack/webpack-dev-middleware@56dc705 and released at For now you can remove all of your hacking, just |
notice the version of webpack-dev-server
remove all of hacking, just And I still fail.Then I update webpack-dev-server,which in the relation that requires the webpack-dev-middleware.And success,I hope that help others. |
I ' m working at
3.add resolutions to your package.json file
my package.json file(I used to use vuepress 1.0 but it didn't work and now I use vuepress 0.14.11)
|
NOTE: workaround of vuepress issue: vuejs/vuepress#1417
NOTE: workaround of vuepress issue: vuejs/vuepress#1417
NOTE: workaround of vuepress issue: vuejs/vuepress#1417
Bug report
Version
Steps to reproduce
NOTE: This was a first time use of vuepress.
Visit
http://localhost:8080/
in browserServer throws ...
The text was updated successfully, but these errors were encountered: