fix(schematics): use the exported logger/compat subpath in generated functions - #3730
Merged
armando-navarro merged 3 commits intoAug 5, 2026
Conversation
…functions
The SSR Cloud Function generated by `ng deploy` crashed at cold start:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath
'./lib/logger/compat' is not defined by "exports" in
node_modules/firebase-functions/package.json
Both generated templates required `firebase-functions/lib/logger/compat`.
firebase-functions declares an exports map, and the internal `lib/` path is not
in it. The exported subpath is `firebase-functions/logger/compat`, which maps
to the same file.
Verified by generating the function source and loading it against a real
firebase-functions install: the shipped path throws, the exported path loads
and emits structured Cloud Logging JSON, which is what the compat logger is
there to do.
This affects the deployed function rather than the build, so it fails at
runtime in Cloud Functions rather than during `ng deploy`, and it is present in
both the 20.x and 21.x lines.
tyler-reitz
approved these changes
Aug 4, 2026
tyler-reitz
left a comment
Collaborator
There was a problem hiding this comment.
Verified against a real install: firebase-functions@6.5.0 declares exactly ./logger and ./logger/compat in its exports map, with no ./lib/* entry, so the shipped path does throw ERR_PACKAGE_PATH_NOT_EXPORTED at cold start. The exported subpath resolves to the same module. Both templates are updated.
Agreed this wants a backport to the next 20.x patch, since the broken path is present there too.
Collaborator
Author
|
Thanks for checking it against a real Agreed on the backport. The cherry-pick onto the next 20.x patch is already on my list for that release, and it is tracked so it will not land on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The SSR Cloud Function generated by
ng deploycrashes at cold start:Cause
Both generated templates require
firebase-functions/lib/logger/compat.firebase-functionsdeclares anexportsmap, and that internal path is not in it. The exported subpath isfirebase-functions/logger/compat, which resolves to the same file.Verification
I generated the function source and loaded it against a real
firebase-functionsinstall. The shipped path throws the error above. The exported path loads and emits structured Cloud Logging JSON, which is what the compat logger is there to produce.Scope
This affects the deployed function rather than the build, so it surfaces in Cloud Functions at cold start rather than during
ng deploy. It is present in both the 20.x and 21.x lines, so it wants a backport to the next 20.x patch.