bug: issues deploying to Cloud Functions
See original GitHub issueIt is not clear what the actual firebase function should load in this case. Also, there is no sveltekit/ directory. I am assuming this is the build directory that svelte-kit build creates?
This is what I have in functions/src/index.ts, and I get a deployment error: Function failed on loading user code
const functions = require("firebase-functions");
const next = require("./build/index.js");
exports.ssr = functions.https.onRequest(next);
I also found two problems with build/index.js:
const app = require('./app.js');
// should be
const app = require(./app.cjs);
// and
const assets_handler = sirv('assets', {
maxAge: 31536000,
immutable: true
});
// is always an exact path, so it doesn't load correctly
// this works sometimes:
const assets_handler = sirv(__dirname + '/assets', {
maxAge: 31536000,
immutable: true
});
I am not sure what the firebase function should load, or how it should load it…
I feel like I am getting closer, but not sure what the code is supposed to be, and I func is not a function error when deploying…
Is this how the Firebase Function should look?
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
Troubleshooting Cloud Functions
Cloud Functions deployment can fail if the entry point to your code, that is, the exported function name, is not specified correctly. The...
Read more >Cloud Function deployment using gcloud failing for updated ...
We made a small change to the code (it was a copy of existing code and tried to deploy. It failed with error...
Read more >[BUG] Permission 'cloudfunctions.functions.list' denied #203
Yes, I have the same issue when try to deploy angular with server-side rendering function.
Read more >"An unknown error has occurred" deploying google cloud ...
The issue is that now I'm getting "an unknown error has occurred" when I try to deploy a new function. I've tried to...
Read more >Google Cloud Service Health
2020 ; Cloud Functions deployments in a new region failing globally, 9 Feb 2020. 5 hours, 31 minutes ; We've received a report...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And that fixed it. Don’t know how I did that. Thanks!
Just side note: It would be cool if you created the firebase function automatically like you have here, but actually create the function when you run deploy. Angular universal does this.
Thanks!
Great!
Given the history of people structuring their Functions every which way, I tried to reduce the restrictions and automation in favor of hints. The only requirement to make the log be quiet is that it finds a snippet of
<functionName> =" in the
index.js` output from the Functions dir.I may look into an auto-generation option, but then I’d have to deal with find and replace on function renames etc. Since it is an event that isn’t going to occur often I think this is a good balance for now.