rishabh3112 / gridsome-plugin-pwa

PWA plugin for gridsome
MIT License
30 stars 18 forks source link

Wrong Icons are generated in built Manifest.json file #8

Closed Edmund1645 closed 5 years ago

Edmund1645 commented 5 years ago

I ran gridsome build to see how the directories look after building for production because I noticed that I don't get the dialog to 'add to homescreen', An array of all images in src is what's passed as icons instead of the one I put in /static

sample of manifest.json file Screenshot from 2019-08-30 20-57-52

what i specified in gridsome.config.js Screenshot from 2019-08-30 20-58-02 I also changed how I linked to the icon but that still gave the same result.

Edmund1645 commented 5 years ago

also I noticed that a service-worker.js file that does nothing is generated in the root directory, and the content of that file keeps duplicating any time I run build.

rishabh3112 commented 5 years ago

Please share minimum reproducible repository.

Edmund1645 commented 5 years ago

Please share minimum reproducible repository.

I don't understand please, like a link to my repository where the entire project is?

rishabh3112 commented 5 years ago

Yes. If you don't want to, you may reproduce the error in minimum possible files, upload to github and share it here. Thanks!

IHIutch commented 5 years ago

This has been noted here: https://github.com/gridsome/gridsome/issues/167#issuecomment-516840467

You can see my manifest.json and see that an icon is generated for every image on my site, rather than just the icon I specify in my gridsome.config.js

rishabh3112 commented 5 years ago

Hi @Edmund1645 and @IHIutch, I have pushed the patch with the fix. let me know if it is a issue anymore.

IHIutch commented 5 years ago

Looks like its working to me :)

dizid commented 5 years ago

Hi, I have spent some time trying to debug this, but don't know what i could do more. After $ npm install gridsome-plugin-pwa and configuringgridsome.config.js i get this error on $ gridsome develop:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at assertPath (path.js:39:11)
    at Object.isAbsolute (path.js:1144:5)

code is : here

Edmund1645 commented 5 years ago

The location you set to your icon has to be absolute, so it should start with static/

rishabh3112 commented 5 years ago

In addition, @dizid you may open a new issue for this as this issue isn't related to your problem.

dizid commented 5 years ago

Thank you @Edmund1645 I have tried dozens of variations and location, same error. with a ./ and without, different file locations etc.

@rishabh3112 I have been solving a few different issues for 2 days now, time to move on.