fix(schematics): use the exported logger/compat subpath in generated functions - #3730
Open
armando-navarro wants to merge 1 commit into
Open
fix(schematics): use the exported logger/compat subpath in generated functions#3730armando-navarro wants to merge 1 commit into
armando-navarro wants to merge 1 commit into
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.
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.