You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to run Eleventy in 2.0 version using a fork of eleventy-garden and I get this error
Original error stack trace: Error: Unfortunately you’re using code that monkey patched some Eleventy internals and it isn’t async-friendly. Change your code to use the async `read()` method on the template instead!
[11ty] at get frontMatter [as frontMatter] (/USER/eleventy-garden/node_modules/@11ty/eleventy/src/TemplateContent.js:133:13)
[11ty] at Object.backlinks (/USER/eleventy-garden/notes/notes.11tydata.js:23:56)
the code it is pointing at is the following:
module.exports = {
layout: "note",
type: "note",
// permalink: "{{ page.filePathStem | customSlugifyPath }}/", // if you want subfolder structure to be repercuted
permalink: "/notes/" + "{{ page.fileSlug | customSlugifyPath }}/",
eleventyComputed: {
title: data => data.title || data.page.fileSlug,
backlinks: (data) => {
const notes = data.collections.notes;
const currentFileSlug = data.page.filePathStem.replace('/notes/', '');
let backlinks = [];
// Search the other notes for backlinks
for(const otherNote of notes) {
const noteContent = otherNote.template.frontMatter.content;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Trying to run Eleventy in 2.0 version using a fork of eleventy-garden and I get this error
the code it is pointing at is the following:
(source)
I'm simply trying to understand what it means. Where can I read about this "async read() method" ?
Beta Was this translation helpful? Give feedback.
All reactions