contentful-nuxt-netlify icon indicating copy to clipboard operation
contentful-nuxt-netlify copied to clipboard

ERROR [Vue warn]: Error in render: "TypeError: Cannot read property 'file' of undefined"

Open prototowb opened this issue 4 years ago • 1 comments

running 'yarn dev' I get:

ERROR [Vue warn]: Error in render: "TypeError: Cannot read property 'file' of undefined"

found in

---> <Pages/index.vue> at pages/index.vue <Nuxt> <Layouts/default.vue> at layouts/default.vue <Root>

prototowb avatar Feb 06 '21 18:02 prototowb

When using the blog template in Contentful, the default images in the Media section are unpublished. As a result, you're trying to fetch the URL of an unavailable image via the Contentful API in your index.vue file.

In your Contentful Space go to Media, tick all images in the list and click publish. Now it will work when you go back to Netlify and trigger deploy.

@sdras maybe Contentful policy regarding the published status of Medias in templates changed since you wrote the tutorial ? Anyway, I'd suggest adding this step in your guide.

DalFanajin avatar Apr 08 '21 15:04 DalFanajin