11ty / eleventy-plugin-directory-output

Group and sort Eleventy’s verbose output by directory (and show file size with benchmarks)
MIT License
20 stars 1 forks source link

Problem with custom template formats #1

Closed schneyra closed 2 years ago

schneyra commented 2 years ago

I'm running in a problem with the custom template formats that I defined. The plugin works great, as long as I don't define such for CSS and JS. If I comment out the lines 53 to 93 in my .eleventy.js the plugin works fine. Is there anything I can do on my side?

[11ty] Problem writing Eleventy templates: (more in DEBUG output) [11ty] > Having trouble writing template: _site/_source/scss/1_settings/_fonts.css

TemplateWriterWriteError was thrown [11ty] > Cannot read property 'length' of undefined

TypeError was thrown: [11ty] TypeError: Cannot read property 'length' of undefined at Object. (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy-plugin-directory-output/.eleventy.js:260:21) at Template.runLinters (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:530:14) at Template.renderPageEntry (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:847:16) at /workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:872:32 at Array.map () at Template.generateMapEntry (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:867:23) at TemplateWriter._generateTemplate (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:251:17) at TemplateWriter.generateTemplates (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:282:14) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async TemplateWriter.write (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:321:23)

The error on the CSS file is just an example, I've had the same message on several JS files.

Here's also the debug output:

[11ty] Having trouble writing template: _site/_source/scss/1_settings/_fonts.css

TemplateWriterWriteError was thrown Eleventy:EleventyErrorHandler (error stack): TemplateWriterWriteError: Having trouble writing template: _site/_source/scss/1_settings/_fonts.css Eleventy:EleventyErrorHandler at /workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:289:15 Eleventy:EleventyErrorHandler at processTicksAndRejections (internal/process/task_queues.js:93:5) Eleventy:EleventyErrorHandler at async Promise.all (index 5) Eleventy:EleventyErrorHandler at async Eleventy.executeBuild (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Eleventy.js:986:13) +0ms [11ty] Cannot read property 'length' of undefined

TypeError was thrown: Eleventy:EleventyErrorHandler (error stack): TypeError: Cannot read property 'length' of undefined Eleventy:EleventyErrorHandler at Object. (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy-plugin-directory-output/.eleventy.js:260:21) Eleventy:EleventyErrorHandler at Template.runLinters (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:530:14) Eleventy:EleventyErrorHandler at Template.renderPageEntry (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:847:16) Eleventy:EleventyErrorHandler at /workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:872:32 Eleventy:EleventyErrorHandler at Array.map () Eleventy:EleventyErrorHandler at Template.generateMapEntry (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:867:23) Eleventy:EleventyErrorHandler at TemplateWriter._generateTemplate (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:251:17) Eleventy:EleventyErrorHandler at TemplateWriter.generateTemplates (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:282:14) Eleventy:EleventyErrorHandler at processTicksAndRejections (internal/process/task_queues.js:93:5) Eleventy:EleventyErrorHandler at async TemplateWriter.write (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:321:23) +1ms

zachleat commented 2 years ago

Please re-test with v1.0.1 of this plugin!

schneyra commented 2 years ago

It works perfectly fine now. <3 Thanks a lot!