The deployment of the Fire-base Cloud Function was successful and error-free. However, the function does not appear to exist in the Firebase system

After deploying a JavaScript Cloud Function, it shows that the deployment is completed. However, when I check Firebase, the function is not there. Oddly, TypeScript Cloud Functions deploy successfully.

I followed all the steps outlined in the original Firebase video tutorial, including installing firebase-tools. Even after attempting to deploy an uncommented "hello world" function, I encountered the same issue.

I've tried reinitializing Firebase multiple times and even reinstalling Node and Firebase tools, but the problem persists. Local emulation also fails, as seen in the provided screenshot.

The index.js file can be viewed here.

View the firebase.json configuration here.

Check out the deployment message in cmd here.

And here's the emulated message in cmd here.

EDIT: When I attempted to deploy with a specified function, this error occurred: https://i.stack.imgur.com/aTqIs.png

Deploying with an empty firebase.json document resulted in this outcome: https://i.stack.imgur.com/NlnUP.png

Lastly, deploying with the recommended firebase.json settings yielded this result: https://i.stack.imgur.com/2ltqV.png

Apologies for the image-heavy post, but formatting code has been challenging for me.

Answer №1

Your function deployment process seems to be encountering an issue.

Typically, when you deploy a new function using the CLI, you should see a series of messages like the following:

=== Deploying to '<PROJECT-ID>'...

i  deploying functions
i  functions: ensuring necessary APIs are enabled...
✔  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (26.61 KB) for uploading
✔  functions: functions folder uploaded successfully
i  functions: creating Node.js 8 function <FUNCTION-NAME>(us-central1)...
✔  functions[<FUNCTION-NAME>(us-central1)]: Successful create operation. 
Function URL (<FUNCTION-NAME>): https://us-central1-<PROJECT-ID>.cloudfunctions.net/<FUNCTION-NAME>

✔  Deploy complete!

Project Console: https://console.firebase.google.com/project/<PROJECT-ID>/overview

It appears that in your case, the 'Successful' message is missing from your deployment screenshot.

To troubleshoot this issue, I recommend trying to deploy your functions with an empty JSON as the firebase.json file.

When deploying, make sure to execute

firebase deploy --only functions:<FUNCTION_NAME>
in the project's root directory. This command specifies which function to deploy - in your case, it would be helloWorld.

If you still don't receive the 'Successful' message after redeploying, please share the results here so we can assist further.

Edit.

You might also want to consider updating your firebase.json configuration to include predeploy steps like linting and building:

{ 
    "functions":{ 
        "source": "functions/",
         "predeploy": [
             "npm --prefix \"$RESOURCE_DIR\" run lint",
             "npm --prefix \"$RESOURCE_DIR\" run build"
         ]
    }
}

After making these changes, try deploying again to see if it resolves the issue.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to create a React component that renders a class component as a functional component?

My Objective: At the moment, I am in the process of developing an AuthUserRole HOC component to manage user roles like Manager and Employee. However, I encountered a tutorial that uses a functional component to return a class component as referenced here. ...

Design cards in a particular sequence using either bootstrap or CSS

I am currently developing a blog website and I need assistance with arranging the cards in this specific order: https://i.sstatic.net/Ffpcb.png Despite my efforts using Bootstrap, I am unable to achieve the desired layout. Here is the code I have so far: ...

In JavaScript, what do we call the paradigm where a variable equals a variable equals a function? Let's take

Feeling a bit overloaded at the moment, so forgive me if this question seems too simple. I managed to accidentally write some code in Jest for testing a Vue application that actually works: const updateMethod = wrapper.vm.updateMethod = jest.fn() expect(u ...

Show where the image should be placed according to the coordinates of the mouse click

My project begins with a blank canvas, prompting the user to click anywhere on the page to reveal an image. My goal is to show an image at the exact location where the user clicks. Although I can successfully trigger an image to appear in the corner of the ...

Clicking on a column or x-axis category in Highcharts will automatically include the job number in the page URL

Check out the code I've put together: http://jsfiddle.net/a9QwS/ I'm looking to add functionality where clicking on a column or x-axis label will append its data to the URL. For example, in PHP, I can do something like this: echo " <td sty ...

Empty Ajax array sent to PHP

I am encountering an issue with my ajax form where the values in an array are coming out as null in my PHP response. I suspect that there may be a mistake in my .ajax call. Can anyone provide suggestions or insights on how to resolve this issue? My code sn ...

Is the NodeJS debugger prone to crashing when utilizing `this` to invoke an unidentified function?

My JavaScript file contains the code below: (function (context) { console.log(123); debugger; })(this); When I run my script in debug mode like this: $ node debug script.js I noticed that the other lines in debug mode are not colored green. Wha ...

Tips for restricting User access and displaying specific sections of the menu

I have a component that utilizes map to display all menu parts. Is there a way to make certain parts of the menu hidden if the user's access rights are equal to 0? const Aside: React.FunctionComponent = () => { const[hasRight, setHasRight] = us ...

How can we reset multiple selected values (mui chips) in a React Material-UI Autocomplete field when changing the value in a different field?

Is there a way to clear the mui-chips in Material UI Autocomplete TextField when the value in another field is changed? I have been struggling with clearing the subtype value when the Type value changes. Although I can update the drop-down options based on ...

Pull data from Firestore collections and store them in an ArrayList using Java within Android Studio

I'm currently working on developing an application that can extract values from a Firestore array and store them in an ArrayList. Here's the code I have so far: ArrayList<Integer> driverPermissions = new ArrayList<>(); Firest ...

When trying to reference "this" and store it in a variable, it appears as undefined. However, DevTools show that it is actually defined

I've encountered an unusual situation in my React app involving the binding of "this" - I have a function within a component named "App" that is located in a separate file. In the main file, I've bound the "this" command to it. What's puzzl ...

Implementing a keypress function that can handle duplicate names

HTML <input name="pm" type="text" value="0"/> <input name="pm" type="text" value="0"/> <input name="pm" type="text" value="0"/> <input name="total" type="text" value="0" disabled="disabled"/> Javascript $('[name="pm"]' ...

Can a Vue component in SFC form be utilized as a mixin?

Consider this scenario, where I have a component created in SFC format: // Parent.vue <template> <div> {{ txt }} </div> </template> <script> export default { name: 'ParentComponent', data() { return ...

Issue with 1.bundle.js not loading during webpack production build with routing

I have been encountering an issue with my test repository for this specific problem (Link) It appears that the problem lies within the localization file, as I am using react-intl. The development version seems to be functioning properly. This is what&ap ...

Setting up route handlers in Node.js on a pre-initialized HTTP server

Is there a way to add route handlers to an http server that is already instantiated? Most routers, including express, typically need to be passed into the http.createServer() method. For instance, with express: var server = http.createServer(app); My r ...

Ways to remove a JSON item based on its index position?

In my JSON object, I am trying to find a way to remove the first element. Here is an example of what I have: var obj1 = {property:'something', does:'somethingElse', is:'somethingCool'}; var obj2 = {does:'somethingElse&ap ...

Unusual behavior exhibited by dynamic code in iframe

When trying to retrieve a dynamic height iframe, I implement the code below. In the <head> area <script language="javascript" type="text/javascript"> function adjustIframe(obj) { obj.style.height = obj.contentWindow.document.body.scrollHeight ...

Changing route parameters or query parameters does not trigger a reload of component data in React

The "home" component has links that direct to the product component when clicked. Another component always visible displays links to recently visited products. However, on a product page, these links fail to work properly. Although the URL updates and tri ...

Change the text of a button by using an input field

How can I dynamically update button text based on input field value? <input class="paymentinput w-input" type="tel" placeholder="0" id="amount-field"> <button id="rzp-button1" class="paynowbutton w-button">Pay Now</button> I want the bu ...

Issue with scroll being caused by the formatting of the jQuery Knob plugin

I am currently utilizing the jQuery Knob plugin and I am looking to have the displayed value shown in pound sterling format. My goal is for it to appear as £123456. However, when I attempt to add the £ sign using the 'format' hook, it causes is ...