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
bug: Specifying provideIonicAngular() in a route provider prevents hydration from completing #29324
Comments
Thanks for the issue. I am going to close this as this is not a bug in Ionic Framework. To fix this, your application should either use |
@liamdebeasi I have fixed the repro to only use standalone and it still does not show anything when provided in the route provider. The issue may be different from the original hydration issue mentioned |
|
My use-case is for micro-frontends where each remote is responsible for its own providers and the shell application should not have to add root providers for the remote applications in it. |
You'll want to make sure that the I'm assuming here that the remote application is a complete Angular application instead of a single component. |
It is built as a complete Angular application, so it does have main.ts and root providers when running as a standalone app. When it is integrated inside a host app as a micro-front-end remote, the remotes main.ts and root providers are bypassed and the host loads an entry point to the remote, which is the routes file containing the initial route the host must navigate to. This route needs to provide all the providers that the remote requires. As a workaround, I am including the Ionic provider in the host app but this means that Ionic is loaded even if users do not navigate to the remote. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
Specifying
provideIonicAngular()
in a route provider prevents the hydration from completing successfullyThe CSS display property does not update
html:not(.hydrated) body {
display: none;
}
Expected Behavior
When providing provideIonicAngular() in the bootstrap config it works as expected:
html.ion-ce body {
display: block;
}
html:not(.hydrated) body {
display: none;}
Steps to Reproduce
Use the reproduction url below.
Open main.ts
Inspect the body tag to see the issue.
Uncomment the line and the display works as expected
Code Reproduction URL
https://stackblitz.com/edit/angular-pmvzjr?file=src%2Fmain.ts,src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fexample.component.html
Ionic Info
Ionic:
Ionic CLI : 7.2.0
Utility:
cordova-res : not installed globally
native-run : not installed globally
System:
NodeJS : v20.9.0
npm : 10.1.0
OS : macOS Unknown
Additional Information
No response
The text was updated successfully, but these errors were encountered: