Today was my first time trying to deploy functions on Firebase.
When I ran $ firebase deploy in the terminal, a Parsing error occurred as shown below.
I noticed that the path to the tsconfig.json file seemed strange.
There appears to be a duplication of the Functions directory.
However, I am unable to find a solution to this problem.
...
Running command: npm --prefix "$RESOURCE_DIR" run lint
> lint
> eslint --ext .js,.ts .
/Users/mies/FirebaseProjects/{MyProject}/functions/.eslintrc.js
0:0 error Parsing error: Cannot read file '/users/mies/firebaseprojects/{MyProject}/functions/functions/tsconfig.json'
/Users/mies/FirebaseProjects/{MyProject}/functions/src/index.ts
0:0 error Parsing error: Cannot read file '/users/mies/firebaseprojects/{MyProject}/functions/functions/tsconfig.json'
✖ 2 problems (2 errors, 0 warnings)
Error: functions predeploy error: Command terminated with non-zero exit code 1
The current structure of the project is as follows.
{MyProject}
+- functions/
+- node_modules/
+- src/
+- index.ts
+- .eslintrc.js
+- .gitignore
+- package-lock.json
+- package.json
+- {serviceAccount}.json
+- tsconfig.dev.json
+- tsconfig.json
+- .firebaserc
+- .gitignore
+- firebase.json
+- firebase.indexes.json
+- firebase.rules
.eslintrc.js
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"google",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["./functions/tsconfig.json", "./functions/tsconfig.dev.json"],
sourceType: "module",
},
ignorePatterns: [
"/lib/**/*", // Ignore built files.
],
plugins: [
"@typescript-eslint",
"import",
],
rules: {
"quotes": ["error", "double"],
"import/no-unresolved": 0,
},
};
How do I fix the root from /functions/functions to just /functions? Is this the correct reason for the error occurring?