-
Notifications
You must be signed in to change notification settings - Fork 941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multilevel function declaration deployment failed - this stoped working #6419
Comments
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information. |
Hi @vincekruger, thanks for reporting this issue. I was able to replicate the error you mentioned using the sample code snippet you provided. I modified it a bit to include functions code: import {onRequest} from "firebase-functions/v2/https";
import {
onDocumentWritten,
} from "firebase-functions/v2/firestore";
const httpFunc = onRequest((req, res) => {
res.send("Hello World");
});
const trigger1 = onDocumentWritten("users/{id}", (event) => {
console.log(`users: ${event}`);
});
const trigger2 = onDocumentWritten("pets/{id}", (event) => {
console.log(`pets: ${event}`);
});
export const codebase = {
httpFunc,
trigger: {
trigger1,
trigger2,
},
}; The above code snippet would result in an error. However, as you mentioned, rearranging them to the code snippet below raises no errors during deployment: export const codebase = {
httpFunc,
trigger1,
trigger2,
} Let me notify our team about this issue so that we can investigate the cause. |
Woohoo I'm not crazy! 🤪 |
Should be fixed by #6423 |
Environment info
firebase-tools: 12.6.1
Platform: macOS 14
Test case
Steps to reproduce
I've discovered something very strange.
This issue started yesterday after upgrading to 12.6.1, however, it shouldn't be related, but it's the only thing that changed.
Fail
Deploying
functions deploy --only functions
index.js example
The logs are unhelpful and don't provide any clues.
now if I go and shuffle the index file around and have only one level of exports everything works perfectly. Zero problems.
This is weird behaviour.
Expected behavior
Deployment successful.
Actual behavior
Deployment fails.
The text was updated successfully, but these errors were encountered: