lannodev/angular-tailwind

Attempt to Implement PWA in the Project

Closed this issue · 3 comments

I really liked the project and I'm wondering how to make it a PWA. I tried with npx ng add @angular/pwa --force ,but still without success. I'm not sure if the plan is to make it a PWA as well, but I will try to implement it and I appreciate your work.

Hi fabio, To be honest I've never used @angular/pwa
I will study more about this.

@fabiobrasileiroo The version of @angular/service-worker should be the same as @angular/core from the project. In this case, you need to install version 18.0.6 using npm i @angular/service-worker@18.0.6. Furthermore, I have updated the project to the latest version of Angular 18.

Reverting this error is when I try to use --force and run it, it seems to work. I have already tried updating the project to avoid this error in Angular version 18.1.0, but when I run server.js pointing to the build, it does not work, just like in version 18.0.6. I don't know if the folder structure changed in the build, but when I go to the application in the browser, the application manifest appears to be working, even though the button to go to PWA does not appear in the browser.

angular
m

Msg error:


npm i @angular/service-worker@18.0.6
npm error code ERESOLVE

npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: angular-tailwind@0.7.0
npm error Found: @angular/common@18.1.0
npm error node_modules/@angular/common
npm error   @angular/common@"^18.1.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @angular/common@"18.0.6" from @angular/service-worker@18.0.6
npm error node_modules/@angular/service-worker
npm error   @angular/service-worker@"18.0.6" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/fabiotrocados/.npm/_logs/2024-07-17T13_50_29_647Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/fabiotrocados/.npm/_logs/2024-07-17T13_50_29_647Z-debug-0.log