Html-webpack-plugin: Cannot read property 'headTags' of undefined

Created on 7 Oct 2019  路  3Comments  路  Source: jantimon/html-webpack-plugin

<%= htmlWebpackPlugin.tags.headTags %> broken.
I figure this out with
<%= htmlWebpackPlugin.files.js.map(src => `<script type="text/javascript" src="${src}"></script>`).join("\r\n ") %>

Most helpful comment

@hackteck It looks like this feature is only available in the 4.0 beta versions. Judging by this, the property should be available https://github.com/jantimon/html-webpack-plugin/blob/bf017f31e29161bdcafb03cff90fb635ed54438a/index.js#L998-L1002

I ran into this problem because vue-cli is relying on 3.2, which doesn't appear to have the property https://github.com/jantimon/html-webpack-plugin/blob/e2c6990e94b298ff66bcd885c9a03a78221479f6/index.js#L722-L725

Does anyone know if it is possible to access these prepared tags in 3.2? I looked for them using the templateParameters function, but so far no luck.

All 3 comments

@hackteck It looks like this feature is only available in the 4.0 beta versions. Judging by this, the property should be available https://github.com/jantimon/html-webpack-plugin/blob/bf017f31e29161bdcafb03cff90fb635ed54438a/index.js#L998-L1002

I ran into this problem because vue-cli is relying on 3.2, which doesn't appear to have the property https://github.com/jantimon/html-webpack-plugin/blob/e2c6990e94b298ff66bcd885c9a03a78221479f6/index.js#L722-L725

Does anyone know if it is possible to access these prepared tags in 3.2? I looked for them using the templateParameters function, but so far no luck.

@scottbedard just yarn upgrade html-webpack-plugin@^4.0.0 ?

as @mecampbellsoup said this is unfortunately only part of the beta:

https://www.npmjs.com/package/html-webpack-plugin/v/4.0.0-beta.11

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GerkinDev picture GerkinDev  路  3Comments

NeverwinterMoon picture NeverwinterMoon  路  3Comments

mmjamal picture mmjamal  路  3Comments

meleyal picture meleyal  路  3Comments

MatthewKosloski picture MatthewKosloski  路  3Comments