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

htmlWebpackPluginAlterAssetTags is undefined #91

Open
eolme opened this issue Jan 10, 2021 · 8 comments
Open

htmlWebpackPluginAlterAssetTags is undefined #91

eolme opened this issue Jan 10, 2021 · 8 comments
Labels

Comments

@eolme
Copy link

eolme commented Jan 10, 2021

I can't figure out what's wrong, but I have an error:

htmlWebpackPluginAlterAssetTags is undefined

here:

compiler.hooks.compilation.tap(plugin_name_1.PLUGIN_NAME, (compilation) => {
    if (compilation.name) {
        return;
    }
    compilation.hooks.htmlWebpackPluginAlterAssetTags.tapPromise(`${plugin_name_1.PLUGIN_NAME} add safari nomodule fix tags`, (htmlPluginData) => __awaiter(this, void 0, void 0, function* () {
        const element = this.inject === babel_multi_target_options_1.SafariNoModuleFixInject.body ? htmlPluginData.body : htmlPluginData.head;
        element.unshift(this.createSafariNoModuleFixTag());
        return htmlPluginData;
    }));
});

Trace:

TypeError: Cannot read property 'tapPromise' of undefined
    at C:\Repo\org\test\node_modules\@mntm\scripts\node_modules\webpack-babel-multi-target-plugin\dist\src\safari-nomodule-fix\safari.nomodule.fix.plugin.js:107:63
    at SyncHook.eval [as call] (eval at create (C:\Repo\org\test\node_modules\@mntm\scripts\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:99:1)
@eolme
Copy link
Author

eolme commented Jan 10, 2021

deps:

{
  "html-webpack-plugin": "^4.5.1",
  "webpack": "^4.45.0"
}

config:

{
  safari10NoModuleFix: {
    mode: 'inline',
    inject: 'head',
    minify: true
  }
}

@Austaras
Copy link
Contributor

Austaras commented Jan 11, 2021

Well, this is due to html-webpack-plugin v4 changed the way of calling hooks. It's likely to be fixed in #86

@eolme
Copy link
Author

eolme commented Jan 11, 2021

What version is currently compatible?

@Austaras
Copy link
Contributor

html-webpack-plugin v3

@eolme
Copy link
Author

eolme commented Jan 11, 2021

Thanks

@eolme eolme closed this as completed Jan 11, 2021
@DanielSchaffer
Copy link
Owner

DanielSchaffer commented Jan 12, 2021

@Austaras html-webpack-plugin@^4.0.0 should be supported as of 2.5.0 via #55

@eolme if this is breaking on webpack-babel-multi-target-plugin@2.5.0 and html-webpack-plugin@^4.0.0, then it's a bug and this should be open.

@Austaras
Copy link
Contributor

@DanielSchaffer yes this should be open. The bug is simple: safari fix plugin isn't updated in #55

@Leeingnyo
Copy link

Are there any updates on this?

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

No branches or pull requests

4 participants