pwa-module: Nuxt build stuck at 95% with @nuxtjs/pwa enabled

https://cmty.app not posting messages so I managed to paste the issue template here ๐Ÿ˜ƒ

Version

v3.0.0-beta.16

Reproduction link

http://see-additional-comments.dev

Steps to reproduce

  • On macbook: install @nuxtjs/pwa with yarn
  • add @nuxtjs/pwa in nuxt.config.js modules
  • run yarn dev or nuxt
  • build script hangs at 95%

What is expected ?

Build script should finish

What is actually happening?

Build script is stuck at


     โ”‚                                             โ”‚
       โ”‚   Nuxt.js v2.8.1                            โ”‚
       โ”‚   Running in development mode (universal)   โ”‚
       โ”‚                                             โ”‚
       โ”‚   Listening on: http://localhost:3000/      โ”‚
       โ”‚                                             โ”‚
       โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
    
    โ„น Preparing project for development                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    09:19:13
    โ„น Initial build may take a while                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       09:19:13
    โœ” Builder initialized                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  09:19:13
    โ€บ App root: /Users/hugo/dev/some-app                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         09:19:13
    โ€บ Generating nuxt files                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                09:19:13
    โ€บ Generating routes...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 09:19:13
    โœ” Nuxt files generated                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 09:19:13
    โ€บ Creating webpack middleware...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       09:19:17
    
    โ— Client โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ emitting (95%) nuxt-pwa-icon 
    
    
    โœ” Server
      Compiled successfully in 17.68s

If I try nuxt build, I got a little more verbose error message:

     nuxt build
    โ„น Production build                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     09:23:03
      plugin:nuxt-rfg-icon Retrieving favicons from realfavicongenerator api +0ms
      plugin:nuxt-rfg-icon Finished adding favicons as assets +11s
    โœ” Builder initialized                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  09:23:14
    โœ” Nuxt files generated                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 09:23:14
    
    โ— Client โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ emitting (95%) nuxt-pwa-icon 
    
    
    โ—ฏ Server
    
    
    
     ERROR  (node:65879) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   09:23:18
    
    
     FATAL  ENOENT: no such file or directory, open '/Users/hugo/dev/some-app/node_modules/@nuxtjs/icon/.cache/a71aaa/64.png'                                                                                                                                                                                                                                                                                                                                                                                                                                                                    09:23:48
    
    
    
    
       โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
       โ”‚                                                                                                                                        โ”‚
       โ”‚   โœ– Nuxt Fatal Error                                                                                                                   โ”‚
       โ”‚                                                                                                                                        โ”‚
       โ”‚   Error: ENOENT: no such file or directory, open '/Users/hugo/dev/some-app/node_modules/@nuxtjs/icon/.cache/a71aaa/64.png'   โ”‚
       โ”‚                                                                                                                                        โ”‚
       โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Additional comments?

Iโ€™m really sorry I canโ€™t provide a repro link, but this bug is only happening on my macbook (on linux/server env everything runs nice). I updated XCode additional components to latest version then nuxt stopped building. Could it be related?

I tried:

  • removing node_modules whole folder & re-installing with yarn
  • removing .nuxt folder
  • rebooting my computer (who knows?)

Edit : I tried with pwa-icon setup without icon :

['@nuxtjs/pwa', {icon: false }],

And it works. Really weirdโ€ฆ

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 19
  • Comments: 22 (4 by maintainers)

Most upvoted comments

Hi @manniL

Nice catch: I tried removing nuxt-rfg-icon. It was still stuck. Then I removed my node_modules folder, ran yarn again. And nuxt worked. ๐Ÿ˜ฒ

So I added nuxt-rfg-icon back again and everything seems to work as normal.

Thanks for pointing it out. Iโ€™ll come back if something break again (I hope not)

Cheers ๐Ÿป

I have the same problem on my production vps, but on development enviroment all works fine.

If it helps, the most recent version that will compile for me is @nuxtjs/pwa@3.0.0-beta.14

Should be fixed by 3.1.0 (thanks to @1ed โค๏ธ )

@pi0 Ok I think I figured this out - when generating the icons, the icon module attempts to start the node inspector. Since I was running with the --inspector flag in development mode, the inspector had already been started and thus the build fails when attempting to add the icons to the proper hash directory within the .cache directory.

Adding to the confusion, when you attempt to recreate the error, the cache directory for the hash has already been created. Since the icon module only checks to see if the directory exists when creating the icons, it assumes that the icons have already been created when they actually havenโ€™t.

Iโ€™m not sure where the node inspector is started within the pwa-icon module, my my suggested fixes would be:

Iโ€™m having the same issue on 3.0.0-beta.20

Likewise, setting icon to false allows the compilation to complete.

Once I rolled back to 2.4.0 it worked even with the icon enabled

npm remove @nuxtjs/pwa
npm install @nuxtjs/pwa@2.4.0

Iโ€™m having this same problem with the latest Nuxt and deleting node_modules and reinstalling did not work for me, nor did wrapping setInterval functions in if (process.client). Adding { icon: false } to the module configuration for @nuxt/pwa in nuxt.config.js worked, but donโ€™t I want my PWA to have an icon?