11ty/eleventy

{{ eleventy.generator }} throwing an error in a liquid layout in 3.0.0-alpha.7

nathan-bottomley opened this issue · 3 comments

Operating system

macOS Sonoma 14.4.1

Eleventy

3.0.0-alpha.7

Describe the bug

I have a <meta> tag in the <head> of a Liquid layout that includes {{ eleventy.generator }}. However, Liquid chokes on this.

[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] 1. Having trouble writing to "./_site/index.html" from "./src/index.html" (via EleventyTemplateError)
[11ty] 2. 'getOwnPropertyDescriptor' on proxy: trap reported non-configurability for property 'generator' which is either non-existent or configurable in the proxy target, line:13, col:40, file:./src/_includes/layouts/base.liquid, line:13, col:37 (via RenderError)
[11ty] 3. 'getOwnPropertyDescriptor' on proxy: trap reported non-configurability for property 'generator' which is either non-existent or configurable in the proxy target, line:13, col:40 (via UndefinedVariableError)
[11ty] 4. 'getOwnPropertyDescriptor' on proxy: trap reported non-configurability for property 'generator' which is either non-existent or configurable in the proxy target (via TypeError)
[11ty] 
[11ty] Original error stack trace: TypeError: 'getOwnPropertyDescriptor' on proxy: trap reported non-configurability for property 'generator' which is either non-existent or configurable in the proxy target
[11ty]     at Proxy.hasOwnProperty (<anonymous>)
[11ty]     at readJSProperty (/Users/nathan/Sites/500yeardiary.com/node_modules/liquidjs/dist/liquid.node.cjs.js:2565:51)
[11ty]     at readProperty (/Users/nathan/Sites/500yeardiary.com/node_modules/liquidjs/dist/liquid.node.cjs.js:2551:19)
[11ty]     at Context._getFromScope (/Users/nathan/Sites/500yeardiary.com/node_modules/liquidjs/dist/liquid.node.cjs.js:2518:27)
[11ty]     at _getFromScope.next (<anonymous>)
[11ty]     at toPromise (/Users/nathan/Sites/500yeardiary.com/node_modules/liquidjs/dist/liquid.node.cjs.js:499:32)
[11ty]     at toPromise (/Users/nathan/Sites/500yeardiary.com/node_modules/liquidjs/dist/liquid.node.cjs.js:505:25)
[11ty]     at toPromise (/Users/nathan/Sites/500yeardiary.com/node_modules/liquidjs/dist/liquid.node.cjs.js:505:25)
[11ty]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[11ty]     at async toPromise (/Users/nathan/Sites/500yeardiary.com/node_modules/liquidjs/dist/liquid.node.cjs.js:507:25)

I'm trying to create the smallest possible project that reproduces the problem, but without success. The problem doesn't occur out of the box, and I'm racking my brain to work out what I've done in my project that might cause it. I'm happy to try anything if anyone can suggest where to look.

In any case, I wasn't having this problem in alpha.6, so I wonder if it might be related to the work done in alpha.7 about preventing changes to Eleventy-supplied data.

Reproduction steps

No response

Expected behavior

No response

Reproduction URL

No response

Screenshots

No response

Reproduced this one! It’s {{ eleventy.generator }} in a pagination template.

You can use eleventyConfig.setFreezeReservedData(false) to opt-out of this behavior for now! See #3251

Fixed in 3.0.0-alpha.8 3.0.0-alpha.9 (now available)