Error when running vapid start


#1

I originally posted this on GitHub, but since I got the intention that these types of errors should be posted in this forum, I’ll post it here as well.

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

#2

I am having the same issue.

OSX 10.14.3
Node 10.15.0
Vapid 0.7.3


#3

same issue with me as well

OSX 10.13.6
Node 10.15.0
Vapid 0.3.5


#4

The latest release of Vapid, v0.7.4, fixes this issue. To update:

npm install -g @vapid/cli