netlify-plugin-sitemap
netlify-plugin-sitemap copied to clipboard
TemplateContentRenderError in plugin's node_modules in builds with 11ty v1.0.0
Describe the bug
Sites using "@11ty/eleventy": "^1.0.0" and this plugin cause the following error when deployed:
11:29:45 AM: > npx @11ty/eleventy
11:29:46 AM: [11ty] Problem writing Eleventy templates: (more in DEBUG output)
11:29:46 AM: [11ty] > Having trouble rendering njk template ./.netlify/plugins/node_modules/balanced-match/README.md
11:29:46 AM: `TemplateContentRenderError` was thrown
11:29:46 AM: [11ty] > (./.netlify/plugins/node_modules/balanced-match/README.md) [Line 50, Column 133]
11:29:46 AM: expected variable end
11:29:46 AM: `Template render error` was thrown:
11:29:46 AM: [11ty] Template render error: (./.netlify/plugins/node_modules/balanced-match/README.md) [Line 50, Column 133]
11:29:46 AM: expected variable end
11:29:46 AM: at Object._prettifyError (/opt/build/repo/node_modules/nunjucks/src/lib.js:36:11)
11:29:46 AM: at Template.init (/opt/build/repo/node_modules/nunjucks/src/environment.js:511:19)
11:29:46 AM: at Template.Obj (/opt/build/repo/node_modules/nunjucks/src/object.js:62:15)
11:29:46 AM: at new Template (/opt/build/repo/node_modules/nunjucks/src/environment.js:478:18)
11:29:46 AM: at Nunjucks.compile (/opt/build/repo/node_modules/@11ty/eleventy/src/Engines/Nunjucks.js:479:14)
11:29:46 AM: at Markdown.compile (/opt/build/repo/node_modules/@11ty/eleventy/src/Engines/Markdown.js:63:28)
11:29:46 AM: at TemplateRender.getCompiledTemplate (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateRender.js:231:26)
11:29:46 AM: at Template.compile (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateContent.js:294:42)
11:29:46 AM: at processTicksAndRejections (internal/process/task_queues.js:97:5)
11:29:46 AM: at async Template._render (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateContent.js:388:16)
I wasn't sure if this is an issue I should post in the 11ty repo, but I figured this would be a good place to start. Initially I thought that somehow the .gitignore was not correct since it was going into the node_modules/, but it is the same one that many 11ty sites use.
.gitignore:
_site/
node_modules/
package-lock.json
To Reproduce
Steps to reproduce the behavior:
- Fork the repository
https://github.com/11ty/eleventy-base-blog - See that it successfully deploys to Netlify
- Then add the plugin
- Trigger a new deploy while clearing the cache
- See the error above in the logs
Expected behavior
Successful build with the plugin.
Additional context
Let me know if it has nothing to do with the plugin and I can open an issue on the 11ty repo.