eleventy icon indicating copy to clipboard operation
eleventy copied to clipboard

Using Edge->Nunjucks without a `.njk` template file in your project throws an error

Open zachleat opened this issue 3 years ago • 1 comments

Using an empty project with this as a test.liquid file:

Testing
{% edge "njk,md" %}
Testing
{% endedge %}

throws this error when there are no .njk files in the project

[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] Missing Nunjucks and Nunjucks environment (via Error)
[11ty] 
[11ty] Original error stack trace: Error: Missing Nunjucks and Nunjucks environment
[11ty]     at PrecompiledNunjucks.toString (/Users/zachleat/Temp/eleventy-edge-issues/node_modules/@11ty/eleventy/src/Plugins/Edge/PrecompiledNunjucks.js:30:15)
[11ty]     at AsyncEventEmitter.<anonymous> (/Users/zachleat/Temp/eleventy-edge-issues/node_modules/@11ty/eleventy/src/Plugins/EdgePlugin.js:266:48)
[11ty]     at async Promise.all (index 0)
[11ty]     at async Eleventy.executeBuild (/Users/zachleat/Temp/eleventy-edge-issues/node_modules/@11ty/eleventy/src/Eleventy.js:1085:7)
[11ty]     at async Eleventy.watch (/Users/zachleat/Temp/eleventy-edge-issues/node_modules/@11ty/eleventy/src/Eleventy.js:906:18)
[11ty] Wrote 1 file in 0.03 seconds (v2.0.0-canary.11)

Unlikely folks will run into this in production but definitely a starter/beginner/demo project bug

zachleat avatar May 17 '22 14:05 zachleat

Discovered when testing #2390

zachleat avatar May 17 '22 14:05 zachleat

Per the Eleventy Community Survey results and our refocus and prioritization towards our roots as a static site generator, we’re going to be deprecating Edge in 3.0 and closing issues related to the Edge plugin. I’m very sorry to have to do this—but unfortunately this was a necessary decision to allow the project to continue forward.

Read more: https://www.zachleat.com/web/eleventy-side-project/ https://www.11ty.dev/blog/community-survey-results/

zachleat avatar Nov 11 '23 04:11 zachleat