prismicio-community / eleventy-plugin-prismic

Eleventy plugin and shortcodes to fetch and present Prismic content

Home Page:https://github.com/prismicio-community/eleventy-plugin-prismic/blob/master/DOCUMENTATION.md

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken with Prismic Changes

kingbiscit opened this issue · comments

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

  • @11ty/eleventy: 1.0.0-canary.44
  • eleventy-plugin-prismic: 0.1.2
  • node: 14

Reproduction

npm update

You can see the change here:
prismicio/prismic-client@4efdfa0

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

commented

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 :)