Can’t find layout template in v9.26.0 (using Eleventy v1.0.0-canary.44)
See original GitHub issueUpdating 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:
- Created 2 years ago
- Comments:31 (28 by maintainers)
Top GitHub Comments
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!
I appreciate the movement here but I do think this was a semver breaking change, right?
Are we not allowed to use
options
oroptions.root
in the third argument torender
any more?Should this have been bundled with a major version API change?