GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — fix(app-check)!: skip App Check during server rendering by default by armando-navarro · Pull Request #3773 · angular/angularfire Conversation
Collaborator
Fixes #3488 Following Important This is a breaking change, so it needs to merge before Breaking change
{ provide: APP_CHECK_ON_SERVER, useValue: true }
Changes
VerificationOn an Angular 21.2 app rendered at build time, using the setup from
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsprovideAppCheck ran the app's setup function during server rendering, where the reCAPTCHA providers throw "document is not defined", so following docs/app-check.md broke every prerender and server render. The workaround users posted, returning nothing on the server, failed to compile and left an empty AppCheck object behind. The setup function now runs only in the browser, unless the server config provides APP_CHECK_ON_SERVER as true for a server-capable provider. A skipped server injects AppCheck as null, and development mode warns once. Firebase's documented route for App Check in server renders, an appCheckToken passed to initializeServerApp, is unaffected. BREAKING CHANGE: App Check no longer runs during server rendering unless APP_CHECK_ON_SERVER is provided as true. Fixes angular#3488 Fixes angular#3128 Refs angular#3089
tyler-reitz
approved these changes
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Approving. Verified locally rather than by reading: built the branch and ran Two non-blocking notes:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
This was referenced
armando-navarro
added a commit
to armando-navarro/angularfire
that referenced
this pull request
…uide 21.0.0-rc.2 skips App Check during server rendering (angular#3773). The guide now says so and links the App Check page's server-rendering section.
armando-navarro
added a commit
that referenced
this pull request
…de guide (#3795) * docs: note the removed @angular/platform-server peer in the v21 upgrade guide The upgrade guide's "Other notes" already lists the removed @angular/platform-browser-dynamic peer. The optional @angular/platform-server peer is gone too, and apps need no change. * docs: name the removed peers once in the v21 upgrade guide The line said "peer dependency" twice. Naming both packages before one "peer dependencies" reads better. * docs: name 21.0.0-rc.2 in the upgrade guide's ng update example The example named 21.0.0-rc.1, which would install the older release candidate once 21.0.0-rc.2 is out. * docs: note the App Check server-rendering change in the v21 upgrade guide 21.0.0-rc.2 skips App Check during server rendering (#3773). The guide now says so and links the App Check page's server-rendering section.
armando-navarro
added a commit
that referenced
this pull request
* docs(app-check): explain App Check during server rendering The App Check guide said nothing about server-rendered apps. #3773 stops AngularFire from creating an App Check instance during server rendering, so the new section explains that inject(AppCheck) is null there, that Firebase requests made while rendering carry no App Check token, and how to opt back in with APP_CHECK_ON_SERVER. It also shows a browser-only config for 21.0.0-rc.1 and earlier, where the guide's setup fails with "document is not defined". * docs(app-check): use the dev-mode warning's wording in the SSR section The warning AngularFire prints during server rendering says it skips App Check there. The section now opens with the same words, so a reader arriving from the console finds them.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
breaking change
ProjectsDevelopmentSuccessfully merging this pull request may close these issues. Using with Angular 17 SSR -> document is not defined on initializeAppCheck AppCheck Build Error During Prerender for Angular SSRUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |