[email protected] missing ./v2/auth in exports map despite onAuthUserCreated being documented #1708
Closed
Description
Related issues
[REQUIRED] Version info
- firebase-functions:
6.3.2
- firebase-admin:
13.4.0
- Node.js:
v20.19.3
- Firebase CLI:
14.8.0
- Runtime:
nodejs22
I’ve checked node_modules/firebase-functions/lib/v2/providers/auth.js
— the file exists.
But in firebase-functions/package.json
, the exports section does not include:
"./v2/auth": "./lib/v2/providers/auth.js"
**node:**
<!-- Run node --version and print the output here-->
firebase --version
14.8.0
**firebase-functions:**
- firebase-functions: `6.3.2`
**firebase-tools:**
firebase --version
14.8.0
<!-- Run firebase --version and print the output here-->
**firebase-admin:**
### [REQUIRED] Test case
Missing export for firebase-functions/v2/auth — prevents deployment
I'm encountering an error when trying to deploy a Firebase Function using Gen 2 syntax with [email protected]. Specifically, this line:
js
Copy
Edit
const { onUserCreated } = require("firebase-functions/v2/auth");
...throws this error:
csharp
Copy
Edit
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './v2/auth' is not defined by "exports"
This prevents deployment entirely, as Firebase CLI fails during the function analysis phase with:
vbnet
Copy
Edit
Error: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error
I confirmed that [email protected] is installed, but ./v2/auth is not included in its "exports" map in node_modules/firebase-functions/package.json.
🔍 It seems like this module might be missing or improperly exported in the current release.
Node version: v20.19.3
Firebase CLI: [email protected]
OS: Windows 11
Since this prevents me from deploying the function, I can’t share a live test case — but I can reproduce the error locally as soon as the import line is added.
Is this a known issue with 6.3.2? Should v2/auth be included in the exports map?
### [REQUIRED] Steps to reproduce
<!-- Provide the steps needed to reproduce the issue given the above test case. -->
Reproduction steps
Create a new Firebase Functions project using Gen 2
Install latest firebase-functions (6.3.2)
Attempt to import from "firebase-functions/v2/auth"
Deploy or run locally — it throws the package subpath export error
Additional context
Let me know if there's a version I should be using instead, or if this is expected to be fixed in an upcoming patch. I’d be happy to test a patch or preview version.
Thanks for all your hard work maintaining this library.
### [REQUIRED] Expected behavior
<!-- What is the expected behavior? -->
I'd expect this import to work based on the docs:
js
Copy
Edit
const { onAuthUserCreated } = require("firebase-functions/v2/auth");
### [REQUIRED] Actual behavior
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './v2/auth' is not defined by "exports" in node_modules/firebase-functions/package.json
functions: Loading and analyzing source code for codebase default to determine what to deploy
Serving at port 8298
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './v2/auth' is not defined by "exports" in C:\Users\conta\Dev\Tai-Chi-108\subfunctions\node_modules\firebase-functions\package.json
at exportsNotFound (node:internal/modules/esm/resolve:322:10)
at packageExportsResolve (node:internal/modules/esm/resolve:670:9)
at resolveExports (node:internal/modules/cjs/loader:636:36)
at Module._findPath (node:internal/modules/cjs/loader:716:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1198:27)
at Module._load (node:internal/modules/cjs/loader:1043:27)
at Module.require (node:internal/modules/cjs/loader:1298:19)
at require (node:internal/modules/helpers:182:18)
at Object.<anonymous> (C:\Users\conta\Dev\Tai-Chi-108\subfunctions\index.js:5:31)
at Module._compile (node:internal/modules/cjs/loader:1529:14) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
### Were you able to successfully deploy your functions?
<!-- When you ran `firebase deploy`, did you see any error messages? -->