Issue with deploying Firebase Function in Flutter app

I encountered an issue while trying to deploy a Firebase function for a Flutter application that I am developing in Android Studio. The error message I received during deployment is shown below. Can someone please advise me on how to resolve this?

Running command: npm --prefix "$RESOURCE_DIR" run lint

functions@ lint /Users/johnny/Downloads/flutterApp5/functions eslint .

/Users/johnny/Downloads/flutterApp5/functions/index.js 18:5 error Expected catch() or return
promise/catch-or-return 23:13 error Each then() should return a value or throw promise/always-return 28:13 error Expected catch() or return promise/catch-or-return 28:13 warning Avoid nesting promises
promise/no-nesting 33:21 error Each then() should return a value or throw promise/always-return 45:19 warning Avoid nesting promises promise/no-nesting 45:19 warning Avoid nesting promises promise/no-nesting 48:27 error Each then() should return a value or throw promise/always-return

✖ 8 problems (5 errors, 3 warnings)

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! functions@ lint: eslint . npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the functions@ lint script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR!
/Users/johnny/.npm/_logs/2020-06-14T01_33_52_121Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code1

Answer №1

There seems to be an eslint error present. Take note of the following error messages.

Running command: npm --prefix "$RESOURCE_DIR" run lint

functions@ lint /Users/johnny/Downloads/flutterApp5/functions eslint .

/Users/johnny/Downloads/flutterApp5/functions/index.js 18:5 error Expected catch() or return
promise/catch-or-return 23:13 error Each then() should return a value or throw promise/always-return 28:13 error Expected catch() or return promise/catch-or-return 28:13 warning Avoid nesting promises
promise/no-nesting 33:21 error Each then() should return a value or throw promise/always-return 45:19 warning Avoid nesting promises promise/no-nesting 45:19 warning Avoid nesting promises promise/no-nesting 48:27 error Each then() should return a value or throw promise/always-return

✖ 8 problems (5 errors, 3 warnings)

To resolve this issue, you need to make changes in your code to address the error. Alternatively, consider adjusting the promise/catch-or-return and promise/always-return rules from being categorized as error to warn within your .eslintrc.json configuration file.

For more information, visit https://github.com/xjamundx/eslint-plugin-promise

Additionally

The

npm --prefix "$RESOURCE_DIR" run lint
command corresponds to the functions.predeploy setting found in the firebase.json file.

Here's an example:

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

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

Updating Time Series Data Array with Historical Values - JavaScript

My dataset consists of time series data for stock prices. However, the data is not continuously distributed, with some days missing. I am looking for an efficient way to fill in these missing days with the previous values. In total, there are more than a ...

Utilize jQuery to append YQL output in JSON format to specific IDs in your code

I have a YQL output JSON string at this URL: Check out the YQL JSON here I encountered some other I am exploring why I am facing difficulties in extracting certain items from the returned JSON. For instance, when using jQuery to access the H1 tag within ...

Encountered: java.lang.NoClassDefFoundError: Unable to resolve class: com.google.firebase.FirebaseApp$IdTokenListener;

I'm currently exploring the use of Firebase for a basic CRUD Android application. However, during the instantiation of a Firebase database reference, I encountered an exception at runtime: java.lang.RuntimeException: Uncaught exception in Firebase Da ...

Executing numerous HTTP requests within a single Angular JS controller

After creating multiple Drupal views to generate various JSON endpoints for different HTTP requests using Angular, I find myself in a situation where I have separate controllers for each request in my Angular script (as shown below). However, I am now lo ...

Strategies for avoiding asynchronous behavior in AJAX with JQuery

My questions are best explained through code rather than words. Take a look at the snippet below and try to understand it: $('#all').on('change', function(){ //ONCHANGE RADIOBUTTON, THERE ARE #bdo, #cash also. $.ajax({ type:"GET", ...

Understanding the reason why "undefined" is occurring in Javascript

Can anyone help me understand why the alert at the start is showing "undefined"? The alerts are displayed in this order: "success!" "Data" (the correct value) "undefined" I have gone through several threads and found that the issue usually arises du ...

Prevent duplicate items in an array by utilizing the Map object to add elements

Looking for a way to update an array by adding new values while avoiding duplicates. I've implemented the usage of a Map object to keep track of existing values and tried filtering the new array accordingly. const [items, setItems] = useState([]); ...

What are some strategies to prevent django form fields from being reset or cleared in the event of an error during submission?

I'm utilizing django's registration-redux for user registration, but I'm facing an issue. When I enter the same user ID, it displays an error and clears all the input fields on the form. How can I prevent this error from occurring without cl ...

What steps can be taken to empower users to make changes to pre-selected data within the vue-select component?

Usage of vue-select component: Currently, I am looking for a way to enable my users to edit data that has already been selected. After going through the documentation, I couldn't find a direct method to achieve this. If anyone has experience working ...

Converting a closure from an outdated JavaScript library into a TypeScript class

Hello, I am currently in the process of converting a JavaScript library into TypeScript. Here is the link to the library: https://github.com/msarhan/hijrah-date. I have encountered some challenges when trying to convert the main function into a class. One ...

"Using jQuery to toggle the visibility of multiple divs individually when

I am facing an issue with dynamically generated divs in asp.net. My goal is to display the contents of each div by clicking on its header. I attempted to achieve this using the following code: $(function () { var myHead = $(".toggle-container ...

Don't forget to execute `npm install` and `gulp` before deploying your Clojure application to Her

Can I execute npm install and gulp during the deployment of a Clojure application on Heroku? ...

Implement a JavaScript and jQuery code that alternates between fading in and fading out every two items in a

Can someone help me figure out how to create a loop that fades in and out every 2 items from an unordered list using jQuery? I've been trying to do this, but my loop only processes one item at a time. <div> <ul> <li>item1</li ...

Using the POST method in Node.js is not functioning properly on the Replit server when using express

Recently diving into the world of backend development, I have been utilizing Node.js on a Replit server with express to host an application for handling files: However, hitting a roadblock when attempting to execute a post request! var express = ...

Acquiring profile information in intricate scenarios using passport-facebook with node.js

I'm currently working with the passport-facebook package, but I've encountered an issue with the way it's usually implemented: app.get('/oauth/facebook', passport.authenticate('facebook', {})); This approach doesn' ...

Is it possible to create a form inside a tooltip?

Looking to incorporate a jQuery feature into a form where a simple yes or no question appears upon hovering over it. However, encountering issues getting jQuery to recognize the dynamically created tooltip and submit alert function not working ("$('#w ...

Using jQuery to choose options and change the background color

Hey there, I have a select box below: <select id="events"> <option value="1" style="background-color:green;">Event 1</option> <option value="2" style="background-color:yellow;">Event 2</option> <option value="3 ...

What could be causing req.body to consistently come back as an empty object?

I am struggling with req.body always returning an empty object regardless of what I try. I have experimented with: var jsonParser = bodyParser.json(); and then including jsonParser in the function -> app.post('/api/get-last-project',jsonPar ...

Verify that a certain number of checkboxes are left unchecked

I have a collection of checkbox input elements in my HTML: <input type="checkbox" id="dog_pop_123"> <input type="checkbox" id="cat_pop_123"> <input type="checkbox" id="parrot_pop_123"> My requirement is to check if none of these checkbo ...

Creating a dynamic SlickGrid spreadsheet - a step-by-step guide

My curiosity has been peaked by the SlickGrid plugin. It caught my attention because of the spreadsheet example, but unfortunately I couldn't get it to work. Is it truly feasible to create a spreadsheet where you can select a range of cells and copy/p ...