Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination in 1.0.0 fails when using permalink: false #2167

Closed
anghelos opened this issue Jan 13, 2022 · 4 comments
Closed

Pagination in 1.0.0 fails when using permalink: false #2167

anghelos opened this issue Jan 13, 2022 · 4 comments
Assignees
Labels

Comments

@anghelos
Copy link

This is possibly related to #2161 and #1754 ?

The bug
I'm using pagination along with eleventyComputed and eleventyNavigation to create a dropdown menu with anchor links.
After updating to 1.0.0, rendering fails with below error message.
I tried updating to v1.0.1-canary.2, to check if #1956 fixed this, with no luck.

To Reproduce
Here's the nunjucks template:
(removing "permalink: false" fixes it, but outputs a bunch of empty pages)

---
pagination:
  data: dropdown
  size: 1
  alias: link
  addAllPagesToCollections: true
permalink: false
eleventyComputed:
  eleventyNavigation:
    key: "{{link.key | safe}}"
    parent: "{{link.parent | safe}}"
    url: "#{{link.key | slugify }}"
    order: "{{link.order}}"
---

Expected behavior
On Eleventy 0.12, this was rendering without a hitch.

Error message

[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Writing false from ./content/dropdown_items.njk
[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] > Having trouble writing template: false

`TemplateWriterWriteError` was thrown
[11ty] > The "path" argument must be of type string. Received type boolean (false)

`TypeError` was thrown:
[11ty]     TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type boolean (false)
        at new NodeError (node:internal/errors:371:5)
        at validateString (node:internal/validators:119:11)
        at Object.parse (node:path:913:5)
        at Template._write (C:\NODEJS\Eleventy\karapanou-eleventy\karapanou-eleventy\node_modules\@11ty\eleventy\src\Template.js:817:36)        
        at C:\NODEJS\Eleventy\karapanou-eleventy\karapanou-eleventy\node_modules\@11ty\eleventy\src\Template.js:923:23
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async Promise.all (index 0)
        at async Promise.all (index 56)
        at async Eleventy.executeBuild (C:\NODEJS\Eleventy\karapanou-eleventy\karapanou-eleventy\node_modules\@11ty\eleventy\src\Eleventy.js:986:13)

Environment:

  • OS and Version: Windows 11
  • Eleventy Version: 1.0.0
@anghelos
Copy link
Author

As a reply to a probably deleted comment: I tried updating to v1.0.0-canary.2, with no change.

@zachleat
Copy link
Member

Reproduced this one 🏆

@zachleat
Copy link
Member

This fix is a bit riskier, so it won’t be included with 1.0.1 but will ship with 2.0.0-canary.5

@anghelos
Copy link
Author

I confirm that it's fixed in 2.0.0-canary.6!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants