Skip to content

Commit c61a736

Browse files
committed
ensure local tarball is used
1 parent 040f735 commit c61a736

File tree

4 files changed

+12
-8941
lines changed

4 files changed

+12
-8941
lines changed

integration_test/cli.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ async function buildAndPackSDK(): Promise<void> {
6767
} else {
6868
throw new Error("Failed to find packed tarball");
6969
}
70+
71+
// Note: We don't regenerate package-lock.json here because Firebase deploy
72+
// will run npm install and regenerate it with the correct checksum for the new tarball
7073
}
7174

7275
async function writeFirebaseJson(codebase: string): Promise<void> {
@@ -95,6 +98,15 @@ async function writeFirebaseJson(codebase: string): Promise<void> {
9598

9699
async function deployFunctions(runId: string): Promise<void> {
97100
console.log(`Deploying functions with RUN_ID: ${runId}...`);
101+
// Delete package-lock.json before deploy so Firebase's npm install regenerates it
102+
// with the correct checksum for the newly created tarball
103+
const packageLockPath = join(functionsDir, "package-lock.json");
104+
try {
105+
await fs.unlink(packageLockPath);
106+
console.log("Deleted package-lock.json before deploy (Firebase will regenerate it)");
107+
} catch {
108+
// Ignore if it doesn't exist
109+
}
98110
await execCommand(
99111
"firebase",
100112
["deploy", "--only", "functions"],

0 commit comments

Comments
 (0)