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

Fix type of HtmlTransformer plugins attribute #3403

Merged
merged 1 commit into from
Aug 8, 2024

Commits on Aug 4, 2024

  1. Fix type of HtmlTransformer plugins attribute

    While plugins should be ordered, this attribute seems to be used as a
    map from an extension to that list of plugins rather than the list
    itself; as indicated in the `getPlugins()` method.
    
    In my site I don't do any configuration of this, just using the
    defaults. While trying to update to Eleventy 3 I was running into errors
    
    > Problem writing Eleventy templates:
    > 1. Having trouble writing to "./public/css/base.css", "./public/css/base.css.map" from "./pages/styles.11ty.js" (via EleventyTemplateError)
    > 2. Transform `@11ty/eleventy/html-transformer` encountered an error when transforming ./pages/styles.11ty.js. (via EleventyTransformError)
    > 3. plugins is not iterable (via TypeError)
    >
    > Original error stack trace: TypeError: plugins is not iterable
    >     at HtmlTransformer._getPosthtmlInstance (file:///home/ats/vc/personal/web/node_modules/.pnpm/github.com+11ty+eleventy@c39e896/node_modules/@11ty/eleventy/src/Util/HtmlTransformer.js:39:39)
    >     at HtmlTransformer.transformContent (file:///home/ats/vc/personal/web/node_modules/.pnpm/github.com+11ty+eleventy@c39e896/node_modules/@11ty/eleventy/src/Util/HtmlTransformer.js:142:42)
    >     at Object.<anonymous> (file:///home/ats/vc/personal/web/node_modules/.pnpm/github.com+11ty+eleventy@c39e896/node_modules/@11ty/eleventy/src/defaultConfig.js:125:13)
    >     at Object.fn (file:///home/ats/vc/personal/web/node_modules/.pnpm/github.com+11ty+eleventy@c39e896/node_modules/@11ty/eleventy/src/Benchmark/BenchmarkGroup.js:37:23)
    >     at TransformsUtil.runAll (file:///home/ats/vc/personal/web/node_modules/.pnpm/github.com+11ty+eleventy@c39e896/node_modules/@11ty/eleventy/src/Util/TransformsUtil.js:36:30)
    
    The main problem seemed to be writing `./public/css/base.css.map`. When
    getPlugins was called for that it was finding the `map` method for Array
    which it could not iterate over.
    aschrab committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    7edb47f View commit details
    Browse the repository at this point in the history