prismicio-community / eleventy-plugin-prismic

Eleventy plugin and shortcodes to fetch and present Prismic content
https://github.com/prismicio-community/eleventy-plugin-prismic/blob/master/DOCUMENTATION.md
MIT License
98 stars 5 forks source link

Broken with Prismic Changes #4

Closed kingbiscit closed 3 years ago

kingbiscit commented 3 years ago

It looks like Prismic have made some changes to the client:

[eleventy:default] [11ty] > client.getAll is not a function [eleventy:default] [eleventy:default] TypeError was thrown: [eleventy:default] [11ty] TypeError: client.getAll is not a function

Versions

Reproduction

npm update

You can see the change here: https://github.com/prismicio/prismic-client/commit/4efdfa0383e448e2d09c50c42804803358438b05

kingbiscit commented 3 years ago

This can easily be fixed by changing

const crawlAndSort = async (client, options = {}) => { const docs = await client.dangerouslyGetAll();

But it might make more sense to make singletons mandatory and loop through that using getAllByType

lihbr commented 3 years ago

Great catch! Let me fix that quick ☺️

TBH I don't want to make singletons mandatory as I prefer the plugin to remain as straightforward as possible to use in its most basic form. This is of course very open to discussion :)