1

I'm working on two React projects.

In both projects, the manifest.json file is set up correctly and The serviceworker is also registered.

In one of the projects, the question of adding to the home screen is not asked.

From the research I've done, I've found that a project that doesn't work properly can't find a file in .license format, but in a project that works properly, it's a file with a .license.txt format.

What makes the difference between the two files when it is taken from the building project? How can this problem be solved?

Photo of the project that works properly and displays the install app prompt

Photo of the project that works properly and displays the install app prompt

The project photo does not work properly and does not show the install app prompt

The project photo does not work properly and does not show the install app prompt

error message in console

error message in console

ecoplaneteer
  • 1,918
  • 1
  • 8
  • 29
Arman
  • 421
  • 3
  • 10
  • Does your PWA when running with an HTTPS URL pass as a valid PWA with the Chrome Lighthouse tool? If there are issues, it usually gives good hints. – Mathias Apr 07 '20 at 14:51
  • I reported on the app by lighthouse. But the report states that the service worker was not registered. But as you can see in the previous photos, the service worker is saving the files in cache and only has a problem with the .license file. – Arman Apr 08 '20 at 10:20
  • Lighthouse is probably giving you some good suggestions on what to fix. Look through pop up the hints shown with each message you see there. – Mathias Apr 08 '20 at 12:58

1 Answers1

0

Finally I found the solution to the problem. If you have ejected the project, you can add a field called extractComments with a false value in the webpack.config.js file in the TerserPlugin section. If you have not ejected the project, you can solve this problem by creating a webpack.config.js file and adding the Terser module with the default settings and adding the extractComments field with a false value. The following links may be helpful in understanding and resolving the issue.

license-to-kill-your-PWA

terser-plugin

Arman
  • 421
  • 3
  • 10