Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateContentRenderError in plugin's node_modules in builds with 11ty v1.0.0 #89

Open
tbarn opened this issue Mar 26, 2022 · 0 comments

Comments

@tbarn
Copy link

tbarn commented Mar 26, 2022

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:

  1. Fork the repository https://github.com/11ty/eleventy-base-blog
  2. See that it successfully deploys to Netlify
  3. Then add the plugin
  4. Trigger a new deploy while clearing the cache
  5. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant