-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PWA ng-add schematic does not work if bootstrapApplication is used (standalone) #23316
Comments
Instead of only looking for import { importProvidersFrom } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
// [...]
bootstrapApplication(AppComponent, {
providers: [
importProvidersFrom(
ServiceWorkerModule.register('ngsw-worker.js', {
enabled: environment.production,
// Register the ServiceWorker as soon as the application is stable
// or after 30 seconds (whichever comes first).
registrationStrategy: 'registerWhenStable:30000',
})
),
],
}); This works fine for my app. For everyone looking for a solution: As a workaround, you can setup a temporary NgModule AppModule and use the |
Developer Preview APIs currently do not have full tooling support. Additional tooling support for Standalone Components will be added in the 14.x timeframe as the APIs are stabilized. |
I see! Thanks for the clarification 😊 |
I faced same issue today, detail I described here https://stackoverflow.com/questions/73274104/ng-add-angular-pwa-bootstrap-call-not-found-in-angular-standalone-project. Look forward to it .... |
Still waiting for the fix |
Today I tried to add angular-pwa to my project running Angular v15 but unfortunately it still does not work with
This is not a preview feature anymore right ? |
This is available in version 16 which is currently in prerelease. |
Closing as per above. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
In the previous version of Angular (13) there was no support for standalone components.
Description
The ng-add schematic for the package
@angular/pwa
does not work if the app bootstraps usingbootstrapApplication
from@angular/platform-browser
instead of the good oldbootstrapModule
function in the apps main.ts file.🔬 Minimal Reproduction
1.) Create a new Angular app with version 14:
2.) Remove the app.module.ts file and change the app.component.ts decorator to
3.) Change the main.ts file to
4.) ng-add @angular/pwa
Run
Answer yes to the following terminal output
🔥 Exception or Error
🌍 Your Environment
I would be very happy to support you with this issue if some guidance is provided.
The text was updated successfully, but these errors were encountered: