question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can’t find layout template in v9.26.0 (using Eleventy v1.0.0-canary.44)

See original GitHub issue

Updating the dependencies for my Eleventy-based website (currently using v1.0.0-canary.44), and updating LiquidJS from v9.25.1 to v9.26.0 generates the following error:

[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] > Having trouble writing template: www/bookmarks/2010/06/star_wars_ipad/index.html

`TemplateWriterWriteError` was thrown
[11ty] > ENOENT: Failed to lookup "default" in "src/includes", file:./src/layouts/bookmark.liquid, line:1, col:1

`RenderError` was thrown
[11ty] > ENOENT: Failed to lookup "default" in "src/includes"

`Error` was thrown:
[11ty]     Error: ENOENT: Failed to lookup "default" in "src/includes"
        at Liquid.lookupError (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/liquidjs/dist/liquid.node.cjs.js:3121:21)
        at Liquid._parseFile (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/liquidjs/dist/liquid.node.cjs.js:3063:20)
        at _parseFile.next (<anonymous>)
        at reduce (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/liquidjs/dist/liquid.node.cjs.js:1737:25)
        at async TemplateLayout.render (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/@11ty/eleventy/src/TemplateLayout.js:160:25)
        at async Template.renderPageEntry (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/@11ty/eleventy/src/Template.js:781:17)
        at async /Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/@11ty/eleventy/src/Template.js:803:21
        at async Promise.all (index 0)
        at async Promise.all (index 9)
        at async Eleventy.executeBuild (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/@11ty/eleventy/src/Eleventy.js:958:13)

As to some background, I have Eleventy set up to look for includes and layouts in separate specified folders. At the top of my templates, I extend a common default.liquid template, i.e.:

{%- layout 'default' -%}
{%- block 'main' -%}
  …
{%- endblock -%}

Eleventy looks for this default template in ./src/layouts/, but since updating to the latest version of LiquidJS, it appears to now be looking for it in /src/includes/. Reverting to v9.25.1 of LiquidJS prevents this error from occurring. Looks like there was a bit of refactoring in the most recent release, which may be the culprit!

Happy to provide more details if required. My site’s code can be found at https://github.com/paulrobertlloyd/paulrobertlloyd-v4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:31 (28 by maintainers)

github_iconTop GitHub Comments

1reaction
zachleatcommented, Nov 8, 2021

The fix for this has made it into Eleventy master and will ship with 1.0.0-beta.5.

Tracking at https://github.com/11ty/eleventy/issues/1995

Thank you @harttle for the PR!

1reaction
zachleatcommented, Oct 9, 2021

I appreciate the movement here but I do think this was a semver breaking change, right?

Are we not allowed to use options or options.root in the third argument to render any more?

Should this have been bundled with a major version API change?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Layouts — Eleventy
Eleventy Layouts are special templates that can be used to wrap other content. To denote that a piece of content should be wrapped...
Read more >
Configuration — Eleventy
Controls the top level directory/file/glob that we'll use to look for templates. Input Directory. Object Key, dir.input. Default Value . (current directory).
Read more >
Eleventy Supplied Data
Here are a few data values we supply to your page that you can use in your templates: pkg : The local project's...
Read more >
Eleventy v1.0.0, the stable release.
Thank you to everyone that built something with Eleventy (×476 authors ... in Layout files moved to be lower precedence, below Template and ......
Read more >
Edge — Eleventy
Try saving your template language syntax preference to persist in ... The Eleventy Edge plugin is bundled with Eleventy, but do note that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found