Deploys failing: plugins have problems writing template files

Let me preface this with saying my build command is npx @11ty/eleventy, and I wonder if I need a different build command / config / params in order to get plugins working with my Eleventy instance. I switched to the Netlify-recommended eleventy command and still got the same error, so perhaps I need to configure a specific build command in my package.json file?

I first tried using the a11y plugin (UI installation), and got this error:

10:37:43 AM: Problem writing Eleventy templates: (more in DEBUG output)
10:37:43 AM: > Having trouble rendering liquid (and markdown) template ./.netlify/plugins/node_modules/axe-core/doc/check-message-template.md
10:37:43 AM: `TemplateContentRenderError` was thrown
10:37:43 AM: > Cannot read property 'join' of undefined, file:./.netlify/plugins/node_modules/axe-core/doc/check-message-template.md, line:112
10:37:43 AM: `RenderError` was thrown
10:37:43 AM: > Cannot read property 'join' of undefined
10:37:43 AM: `TypeError` was thrown:
10:37:43 AM:     TypeError: Cannot read property 'join' of undefined
10:37:43 AM:         at join (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:3248:14)
10:37:43 AM:         at Object.render (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:1914:26)
10:37:43 AM:         at /opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:1807:21
10:37:43 AM:         at Array.reduce (<anonymous>)
10:37:43 AM:         at Object.evalValue$$1 [as evalValue] (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:1806:29)
10:37:43 AM:         at Object._callee4$ (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:1786:30)
10:37:43 AM:         at tryCatch (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:108:40)
10:37:43 AM:         at Generator.invoke [as _invoke] (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:319:22)
10:37:43 AM:         at Generator.prototype.<computed> [as next] (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:156:21)
10:37:43 AM:         at step (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:25:30)
10:37:43 AM: Copied 73 files / Wrote 0 files in 1.25 seconds (v0.11.1)
10:37:43 AM: ​
10:37:43 AM: ────────────────────────────────────────────────────────────────
10:37:43 AM:   "build.command" failed                                        
10:37:43 AM: ────────────────────────────────────────────────────────────────
10:37:43 AM: ​
10:37:43 AM:   Error message
10:37:43 AM:   Command failed with exit code 1: npx @11ty/eleventy

Removed that and tried netlify-plugin-html-validate to see what would happen:

11:21:35 AM: $ npx @11ty/eleventy
11:21:37 AM: Problem writing Eleventy templates: (more in DEBUG output)
11:21:37 AM: > Having trouble rendering liquid (and markdown) template ./.netlify/plugins/node_modules/eslint/CHANGELOG.md
11:21:37 AM: `TemplateContentRenderError` was thrown
11:21:37 AM: > Having trouble compiling template ./.netlify/plugins/node_modules/eslint/CHANGELOG.md
11:21:37 AM: `TemplateContentCompileError` was thrown
11:21:37 AM: > illegal value string: , file:./.netlify/plugins/node_modules/eslint/CHANGELOG.md, line:26
11:21:37 AM: `ParseError` was thrown
11:21:37 AM: > illegal value string:
11:21:37 AM: `AssertionError` was thrown:
11:21:37 AM:     AssertionError: illegal value string:
11:21:37 AM:         at assert (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:1062:11)
11:21:37 AM:         at parseValue (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:2042:5)
11:21:37 AM:         at parseToken (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:2023:15)
11:21:37 AM:         at Object.parse (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:2012:22)
11:21:37 AM:         at Object.parse$$1 [as parse] (/opt/build/repo/node_modules/liquidjs/dist/liquid.common.js:3420:24)
11:21:37 AM:         at Liquid.compile (/opt/build/repo/node_modules/@11ty/eleventy/src/Engines/Liquid.js:199:29)
11:21:37 AM:         at Markdown.compile (/opt/build/repo/node_modules/@11ty/eleventy/src/Engines/Markdown.js:63:25)
11:21:37 AM:         at TemplateRender.getCompiledTemplate (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateRender.js:199:26)
11:21:37 AM:         at Template.compile (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateContent.js:181:42)
11:21:37 AM:         at processTicksAndRejections (internal/process/task_queues.js:97:5)
11:21:37 AM: Copied 73 files / Wrote 0 files in 1.29 seconds (v0.11.1)
11:21:37 AM: ​
11:21:37 AM: ────────────────────────────────────────────────────────────────
11:21:37 AM:   "build.command" failed                                        
11:21:37 AM: ────────────────────────────────────────────────────────────────
11:21:37 AM: ​
11:21:37 AM:   Error message
11:21:37 AM:   Command failed with exit code 1: npx @11ty/eleventy

Any suggestions? Thanks!

Ended up fixing my issue by adding ./.netlify/plugins/node_modules/ to an .eleventyignore file, as I realized Eleventy was trying to treat these as template files. :slight_smile:

1 Like

Nice find! Thanks so much for sharing your learnings :sparkles: