Repository navigation
Functions SDK discovery fails on Windows with Bun-installed executable shims #11386
Description
[REQUIRED] Environment info
firebase-tools: 15.34.2 (installed using Bun)
Platform: Windows, win32; OS version reported by .NET: Microsoft Windows NT 10.0.26300.0
- Bun: 1.4.4
- Local Node.js: v26.13.0
- Configured Functions runtime: Node.js 24
- firebase-functions: 7.4.0
- firebase-admin: 14.5.0
- Shell: PowerShell
- Dependencies installed with Bun; the observed installation uses Bun's isolated node_modules/.bun layout.
[REQUIRED] Test case
The SDK package can be resolved by Node, but Firebase CLI cannot discover its executable because Bun's Windows installation creates firebase-functions.exe and firebase-functions.bunx, without an extensionless firebase-functions file.
This was diagnosed in an existing TypeScript Functions project. The following small JavaScript example isolates the relevant dependency layout and intentionally has no predeploy hooks. A full deployment of this reduced example has not been independently attempted.
Directory structure:
firebase.json
functions/
package.json
index.js
firebase.json:
{
"functions": [
{
"source": "functions",
"codebase": "default"
}
]
}functions/package.json:
{
"name": "functions",
"private": true,
"type": "module",
"main": "index.js",
"engines": {
"node": "24"
},
"dependencies": {
"firebase-admin": "14.5.0",
"firebase-functions": "7.4.0"
}
}functions/index.js:
import { onRequest } from "firebase-functions/v2/https";
export const hello = onRequest((req, res) => {
res.send("Hello");
});[REQUIRED] Steps to reproduce
On native Windows with Bun and Node installed:
-
Create the files above.
-
Install dependencies using Bun:
bun install --cwd functions -
Inspect the generated SDK executable files:
Get-ChildItem functions/node_modules/.bin/firebase-functions*
The original affected installation contained:
firebase-functions.exe firebase-functions.bunx -
Verify package resolution and executable existence without deploying. From
functions/:node --input-type=commonjs -e 'const fs = require("node:fs"); console.log(require.resolve("firebase-functions")); console.log({extensionless: fs.existsSync("node_modules/.bin/firebase-functions"), exe: fs.existsSync("node_modules/.bin/firebase-functions.exe")});'
In the original affected installation, package resolution succeeded and the existence checks returned:
{ extensionless: false, exe: true } -
From the directory containing
firebase.json, deploy to an authorized Firebase project:firebase deploy --only functions --project <project-id>
This deployment error was observed in the original project, not rerun against production during diagnosis.
[REQUIRED] Expected behavior
Firebase CLI should discover and launch the installed Firebase Functions SDK when dependencies are installed with Bun on Windows, without requiring users to create replacement executable wrappers.
[REQUIRED] Actual behavior
Deployment stops during local source analysis:
i functions: Loading and analyzing source code for codebase default to determine what to deploy
Error: Failed to find location of Firebase Functions SDK. Please file a bug on Github (https://github.com/firebase/firebase-tools/).
No complete debug log is attached; the output above is the relevant excerpt from the failed deployment.
Diagnosis
The installed CLI's Delegate.findFunctionsBinary() in src/deploy/functions/runtimes/node/index.ts resolves the SDK package successfully, then checks an exact extensionless path:
const binPath = path.join(nodeModulesPath, ".bin", "firebase-functions");
if (fileExistsSync(binPath)) {
return binPath;
}fileExistsSync() calls fs.statSync(path).isFile(); this check does not perform Windows executable-extension resolution.
In the affected project, all unique lookup paths were checked locally:
- Functions source
node_modules/.bin/firebase-functions: absent;.exepresent. - Firebase project
node_modules/.bin/firebase-functions: absent. - The
node_modules/.bin/firebase-functionsnearest the SDK resolved inside Bun's isolated store: absent;.exepresent.
The SDK itself resolved successfully to node_modules/.bun/firebase-functions@7.4.0+<hash>/node_modules/firebase-functions/lib/v2/index.js.
The same extensionless lookup is present in this source snapshot:
https://github.com/firebase/firebase-tools/blob/bb495945a0be25cb5a98aa2158e613f4b8cac62a/src/deploy/functions/runtimes/node/index.ts
Temporary workaround and local verification
A Windows-only build helper creates:
- An extensionless
node_modules/.bin/firebase-functionsNode launcher requiring the installed SDK's declaredbinentry. - A
firebase-functions.cmdwrapper invoking the same entry with Node and forwarding arguments.
It removes the corresponding Bun .exe and .bunx wrappers so Windows chooses the .cmd wrapper. The helper regenerates these files during each build.
Afterward, local verification confirmed that:
- The installed Firebase CLI's
Delegate.findFunctionsBinary()returns the extensionless launcher. - The CLI's installed
cross-spawncan execute that returned path and obtain the SDK's help output. - Project lint and TypeScript compilation pass.
A full deployment has not been retried, so these checks establish local discovery/launch success rather than end-to-end deployment success.
Related reports
- Any version after 11.17.0 fails to deploy (Failed to find location of Firebase Functions SDK) #5822 reports the same error on Windows with pnpm, but does not document Bun's
.exe/.bunxfilename mismatch. - Functions emulator does not work with yarn configured with pnpm nodeLinker #10813 concerns a different package-manager layout (Yarn with a pnpm nodeLinker).
The original project's Bun predeploy argument-order problem is separately tracked at oven-sh/bun#10333. The reduced example above omits predeploy hooks to keep this report focused on Firebase's SDK executable discovery.
Activity
IzaakGough commentedon Oct 29, 2026
Hi @philemonkipngetich thanks for raising this! We will review as soon as possible.
IzaakGough commentedon Oct 30, 2026
I was able to reproduce this on a windows machine. I will review the fix linked by @abhiramshaji-cyber