fikaproductions / fika-gatsby-source-cockpit

This is a Gatsby version 2.\*.\* source plugin that feeds the GraphQL tree with Cockpit Headless CMS collections and singletons data. Actually, it supports querying raw texts (and any trivial field types), Markdown, images, galleries, assets, sets, repeaters, layout(-grid)s (currently only without nested images/assets), objects, linked collections and internationalization.
GNU General Public License v3.0
23 stars 22 forks source link

TypeError: Cannot destructure property `absolutePath` of 'undefined' or 'null' #2

Closed ta-im-ok closed 5 years ago

ta-im-ok commented 5 years ago

Trying to configure this plugin with the latest Cockpit. Configure @fika/gatsby-source-cockpit, and install the related plugins. Run gatsby develop and get this error: error Plugin @fika/gatsby-source-cockpit returned an error

TypeError: Cannot destructure property absolutePath of 'undefined' or 'null'.

error UNHANDLED REJECTION

TypeError: Cannot read property 'filter' of undefined

WhippetsAintDogs commented 5 years ago

Thanks for reporting that !

It seems like you have Image fields in your Cockpit collections which are currently supported by the plugin. But, it's the way of attaching the image to the entry that causes the problem. I've made sure that attaching a image using the "Select asset" or "Image URL" options both works, but not the "Select image" because I couldn't see the use case for it. Meanwhile, as a workaround, try importing images from the asset manager ("Select asset") instead of using the "Select image" option. I'll add support for it soon.

ta-im-ok commented 5 years ago

Thank you for you very quick and spot on response. I can confirm that your diagnosis and the described remedy works. Everything now works as it should.

artndes9 commented 5 years ago

Facing the same problem with gallery field.. can't say the workaround solves the problem.

WhippetsAintDogs commented 5 years ago

The Gallery field isn't supported right now, coming soon ;)

WhippetsAintDogs commented 5 years ago

@ta-im-ok Importing images using "Select image" should now be working for version +1.0.5.

WhippetsAintDogs commented 5 years ago

@artndes9 The Gallery field type should now be working for version +1.0.6.