[default.hbs] Cannot read property 'feature_image' of undefined

  • What version of Ghost are you using?
    2.17.1

  • What errors or information do you see in the console?

{"name":"Log","hostname":"velobar","pid":23651,"level":50,"req":{"meta":{"requestId":"8b11f7a0-450e-11e9-a2ef-93e50016564f","userId":null},"url":"/shop/","method":"GET","originalUrl":"/shop/","params":{},"headers":{"x-real-ip":"89.137.247.24","x-forwarded-for":"89.137.247.24","x-forwarded-proto":"https","host":"velobar.plus","connection":"close","upgrade-insecure-requests":"1","dnt":"1","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","referer":"https://velobar.plus/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,ro-RO;q=0.8,ro;q=0.7"},"body":{},"query":{}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0"},"statusCode":500,"responseTime":"6909ms"},"err":{"id":"8b181220-450e-11e9-a2ef-93e50016564f","domain":"https://velobar.plus","code":null,"name":"InternalServerError","statusCode":500,"level":"normal","message":"[default.hbs] Cannot read property 'feature_image' of undefined","stack":"InternalServerError: [default.hbs] Cannot read property 'feature_image' of undefined\n    at new GhostError (/var/www/ghost/versions/2.17.1/core/server/lib/common/errors.js:10:26)\n    at _private.prepareError (/var/www/ghost/versions/2.17.1/core/server/web/shared/middlewares/error-handler.js:43:19)\n    at Layer.handle_error (/var/www/ghost/versions/2.17.1/node_modules/express/lib/router/layer.js:71:5)\n    at trim_prefix (/var/www/ghost/versions/2.17.1/node_modules/express/lib/router/index.js:315:13)\n    at /var/www/ghost/versions/2.17.1/node_modules/express/lib/router/index.js:284:7\n    at Function.process_params (/var/www/ghost/versions/2.17.1/node_modules/express/lib/router/index.js:335:12)\n    at next (/var/www/ghost/versions/2.17.1/node_modules/express/lib/router/index.js:275:10)\n    at Layer.handle_error (/var/www/ghost/versions/2.17.1/node_modules/express/lib/router/layer.js:67:12)\n    at trim_prefix (/var/www/ghost/versions/2.17.1/node_modules/express/lib/router/index.js:315:13)\n    at /var/www/ghost/versions/2.17.1/node_modules/express/lib/router/index.js:284:7\n    at Function.process_params (/var/www/ghost/versions/2.17.1/node_modules/express/lib/router/index.js:335:12)\n    at Immediate.next (/var/www/ghost/versions/2.17.1/node_modules/express/lib/router/index.js:275:10)\n    at Immediate._onImmediate (/var/www/ghost/versions/2.17.1/node_modules/express/lib/router/index.js:635:15)\n    at runCallback (timers.js:706:11)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)\n\nTypeError: [default.hbs] Cannot read property 'feature_image' of undefined\n    at getCoverImage (/var/www/ghost/versions/2.17.1/core/server/data/meta/cover_image.js:14:27)\n    at getMetaData (/var/www/ghost/versions/2.17.1/core/server/data/meta/index.js:41:22)\n    at Object.ghost_head (/var/www/ghost/versions/2.17.1/core/server/helpers/ghost_head.js:124:12)\n    at Object.returnAsync (/var/www/ghost/versions/2.17.1/core/server/helpers/register.js:16:28)\n    at Function.Waiter.resolve (/var/www/ghost/versions/2.17.1/node_modules/express-hbs/lib/async.js:83:3)\n    at Object.<anonymous> (/var/www/ghost/versions/2.17.1/node_modules/express-hbs/lib/hbs.js:396:18)\n    at Object.eval [as main] (eval at createFunctionContext (/var/www/ghost/versions/2.17.1/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:257:23), <anonymous>:12:166)\n    at main (/var/www/ghost/versions/2.17.1/node_modules/handlebars/dist/cjs/handlebars/runtime.js:175:32)\n    at ret (/var/www/ghost/versions/2.17.1/node_modules/handlebars/dist/cjs/handlebars/runtime.js:178:12)\n    at ret (/var/www/ghost/versions/2.17.1/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:526:21)\n    at renderTemplate (/var/www/ghost/versions/2.17.1/node_modules/express-hbs/lib/hbs.js:483:13)\n    at _stackRenderer (/var/www/ghost/versions/2.17.1/node_modules/express-hbs/lib/hbs.js:524:9)\n    at /var/www/ghost/versions/2.17.1/node_modules/express-hbs/lib/hbs.js:503:7\n    at Function.Waiter.done (/var/www/ghost/versions/2.17.1/node_modules/express-hbs/lib/async.js:68:12)\n    at renderTemplate (/var/www/ghost/versions/2.17.1/node_modules/express-hbs/lib/hbs.js:494:11)\n    at render (/var/www/ghost/versions/2.17.1/node_modules/express-hbs/lib/hbs.js:531:5)"},"msg":"[default.hbs] Cannot read property 'feature_image' of undefined","time":"2019-03-12T21:34:04.577Z","v":0}

  • What steps could someone else take to reproduce the issue you’re having?
    create page shop
    add to routes.yaml
    navigate to /shop/
routes:
  /shop/:
    data: page.shop
    redirect: false
    template: custom-shop
  /shop/product/:
    data: page.shop
    redirect: false
    template: custom-shop
  /shop/product/:id/:
    data: page.shop
    redirect: false
    template: custom-shop

This was working in version 2.16.4

Thanks for the report!

Can confirm!
We’ll fix this asap.

1 Like

2.17.2 was released.

It works again.
Thanks. :slight_smile:

1 Like

Thanks for confirming :slightly_smiling_face:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.