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

Error when running vapid start #121

Closed
tobiasger opened this issue Mar 6, 2019 · 9 comments

Comments

Projects
None yet
3 participants
@tobiasger
Copy link

commented Mar 6, 2019

Describe the issue
I'm getting an error right after running vapid start <project-name>. vapid new <project-name> is working like it should. I haven't made any changes to the files of the Vapid installation. I can run the vapid start command and everything seems fine, but when I visit localhost:3000 through any browser, the following error pops up in the terminal:

GET / 200 6437 - 260.998 ms [GA1.1.322119533.1548941910]
(node:15125) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
    at processRequest (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/middleware.js:82:18)
    at ready (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/util.js:51:12)
    at handleRequest (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/util.js:167:5)
    at Promise (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/middleware.js:44:7)
    at new Promise (<anonymous>)
    at middleware (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/middleware.js:43:12)
    at Promise.all.Promise (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-webpack/index.js:43:7)
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/vapid-cli/node_modules/koa-webpack/index.js:42:5
    at dispatch (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-compose/index.js:42:32)
    at session (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-session/index.js:41:13)
    at dispatch (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-compose/index.js:42:32)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15125) 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:15125) [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.
(node:15125) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
    at processRequest (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/middleware.js:82:18)
    at ready (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/util.js:51:12)
    at handleRequest (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/util.js:167:5)
    at Promise (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/middleware.js:44:7)
    at new Promise (<anonymous>)
    at middleware (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/middleware.js:43:12)
    at Promise.all.Promise (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-webpack/index.js:43:7)
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/vapid-cli/node_modules/koa-webpack/index.js:42:5
    at dispatch (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-compose/index.js:42:32)
    at session (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-session/index.js:41:13)
    at dispatch (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-compose/index.js:42:32)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15125) 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: 2)
GET /%7B%7Bbackground_image%7D%7D 404 1811 - 11.707 ms [GA1.1.322119533.1548941910]
(node:15125) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
    at processRequest (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/middleware.js:82:18)
    at ready (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/util.js:51:12)
    at handleRequest (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/util.js:167:5)
    at Promise (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/middleware.js:44:7)
    at new Promise (<anonymous>)
    at middleware (/usr/local/lib/node_modules/vapid-cli/node_modules/webpack-dev-middleware/lib/middleware.js:43:12)
    at Promise.all.Promise (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-webpack/index.js:43:7)
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/vapid-cli/node_modules/koa-webpack/index.js:42:5
    at dispatch (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-compose/index.js:42:32)
    at session (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-session/index.js:41:13)
    at dispatch (/usr/local/lib/node_modules/vapid-cli/node_modules/koa-compose/index.js:42:32)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15125) 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: 4)

And nothing is visible in the browser tab showing the localhost:3000 site. When I cancel the process in the terminal, the site is shown, but just as raw markup. So I can see the curly brackets on Hello, {{vapid}}. Not sure if this is a bug with the CLI or if there's something else causing this.

Your Environment

  • OS: OS X 10.13.6
  • Browser: –
  • Node Version: v10.11.0
  • Vapid Version: 0.3.5
@stepjkl

This comment has been minimized.

Copy link

commented Mar 7, 2019

Hi there,

I am having the same exact issue. I wanted to try Vapid for the first time and this came out in the terminal instead (the localhost page keeps loading):

==> Starting the development server...
==> Watching for changes in (project folder)
View your website at http://localhost:3000
Ctrl + C to quit
(node:84710) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
    at processRequest (/usr/local/lib/node_modules/@vapid/cli/node_modules/webpack-dev-middleware/lib/middleware.js:82:18)
    at ready (/usr/local/lib/node_modules/@vapid/cli/node_modules/webpack-dev-middleware/lib/util.js:51:12)
    at handleRequest (/usr/local/lib/node_modules/@vapid/cli/node_modules/webpack-dev-middleware/lib/util.js:167:5)
    at Promise (/usr/local/lib/node_modules/@vapid/cli/node_modules/webpack-dev-middleware/lib/middleware.js:44:7)
    at new Promise (<anonymous>)
    at middleware (/usr/local/lib/node_modules/@vapid/cli/node_modules/webpack-dev-middleware/lib/middleware.js:43:12)
    at Promise.all.Promise (/usr/local/lib/node_modules/@vapid/cli/node_modules/koa-webpack/index.js:43:7)
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/@vapid/cli/node_modules/koa-webpack/index.js:42:5
    at dispatch (/usr/local/lib/node_modules/@vapid/cli/node_modules/koa-compose/index.js:42:32)
    at session (/usr/local/lib/node_modules/@vapid/cli/node_modules/koa-session/index.js:41:13)
    at dispatch (/usr/local/lib/node_modules/@vapid/cli/node_modules/koa-compose/index.js:42:32)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:84710) 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:84710) [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.
(node:84710) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
    at processRequest (/usr/local/lib/node_modules/@vapid/cli/node_modules/webpack-dev-middleware/lib/middleware.js:82:18)
    at ready (/usr/local/lib/node_modules/@vapid/cli/node_modules/webpack-dev-middleware/lib/util.js:51:12)
    at handleRequest (/usr/local/lib/node_modules/@vapid/cli/node_modules/webpack-dev-middleware/lib/util.js:167:5)
    at Promise (/usr/local/lib/node_modules/@vapid/cli/node_modules/webpack-dev-middleware/lib/middleware.js:44:7)
    at new Promise (<anonymous>)
    at middleware (/usr/local/lib/node_modules/@vapid/cli/node_modules/webpack-dev-middleware/lib/middleware.js:43:12)
    at Promise.all.Promise (/usr/local/lib/node_modules/@vapid/cli/node_modules/koa-webpack/index.js:43:7)
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/@vapid/cli/node_modules/koa-webpack/index.js:42:5
    at dispatch (/usr/local/lib/node_modules/@vapid/cli/node_modules/koa-compose/index.js:42:32)
    at session (/usr/local/lib/node_modules/@vapid/cli/node_modules/koa-session/index.js:41:13)
    at dispatch (/usr/local/lib/node_modules/@vapid/cli/node_modules/koa-compose/index.js:42:32)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:84710) 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: 2)
GET / 200 6437 - 94.500 ms [-]

Also, I reinstalled all the global packages including vapid, node.js and npm which are most likely to be the cause from what I researched.

Thank you!

OS X 10.13.6
@vapid/cli: 0.7.3
node: 10.15.3
npm: 6.4.1

@tobiasger

This comment has been minimized.

Copy link
Author

commented Mar 7, 2019

Also, I reinstalled all the global packages including vapid, node.js and npm which are most likely to be the cause from what I researched.

Did it work after this or was there no difference?

@stepjkl

This comment has been minimized.

Copy link

commented Mar 7, 2019

@tobiasger Nope, I still get the same error(s).

@tobiasger

This comment has been minimized.

Copy link
Author

commented Mar 7, 2019

Sorry for doing duplicates, but I read somewhere that errors should be posted in the Vapid Forum, so I did a post there as well. Whichever posts that the maintainers prefer to be closed can be closed.

@srobbin

This comment has been minimized.

Copy link
Contributor

commented Mar 7, 2019

Looks like it's an issue with one of our dependencies. Thankfully, there's a pull request ready that should fix the problem.

If the PR doesn't get merged today, I'll look into a temp fix.

@srobbin

This comment has been minimized.

Copy link
Contributor

commented Mar 7, 2019

I think I found a decent, temporary workaround, at least until that PR is resolved. Try installing the latest version of Vapid (0.7.4), and let me know if that fixes the problem.

To update:
npm install -g @vapid/cli

@tobiasger

This comment has been minimized.

Copy link
Author

commented Mar 7, 2019

Thank you! Updating Vapid fixed it for me. I had a very old version anyways, so I should've just tried that first.

@stepjkl

This comment has been minimized.

Copy link

commented Mar 7, 2019

It is working now, thank you!

@srobbin srobbin closed this Mar 8, 2019

@srobbin

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2019

@tobiasger The other versions would’ve been broken too. 😉

Thanks so much for submitting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.