Vue CLI - vue add pwa causes TypeError: Cannot read properties of undefined (reading 'tapAsync') error

1.3k views Asked by At

I'm building a web app with Vue 3 and after executing vue add pwa I get the following error:
./node_modules/@vue/cli-plugin-pwa/lib/HtmlPwaPlugin.js:62 compilation.hooks.htmlWebpackPluginBeforeHtmlProcessing.tapAsync(ID, (data, cb) => {
TypeError: Cannot read properties of undefined (reading 'tapAsync')

How should I resolve this??

1

There are 1 answers

1
Matt McCallum On BEST ANSWER

This one had me swimming for a bit as well.

upgrade the pwa plugin.

vue upgrade pwa

For me, I was at version 4.5.15 and the latest was 5.0.1