skip to Main Content

i’m working with Firebase Cloud Functions and Node js, suddenly i got this error and don’t know how to solve it.

Cloud function

exports.getNewTest=functions.https.onRequest((request, response) => {
    response.end("Hello World");
});

CLI

Build failed: > build
> tsc

error TS18003: No inputs were found in config file '/workspace/tsconfig.json'. Specified 'include' paths were '["src"]' and 'exclude' paths were '["lib"]'.; Error ID: 1a2262f3

Functions deploy had errors with the following functions:
        getNewTest
i  functions: cleaning up build files...

Error: There was an error deploying functions

Having trouble? Try again or contact support with contents of firebase-debug.log

tsconfig.json

{
  "compilerOptions": {
    "module": "commonjs",
    "noImplicitReturns": true,
    "noUnusedLocals": false,
    "outDir": "lib",
    "sourceMap": true,
    "strict": false,
    "target": "es2020",
    "allowJs": true
  },
  "compileOnSave": false,
  "include": [
    "src"
  ]
}

I have other functions and they work properly. It occurs when i create new functions.

I tried adding "exclude": ["lib"] to tsconfig.json and it doesn’t work

2

Answers


  1. Chosen as BEST ANSWER

    I resolved my problem and just reinstalled Firebase CLI from 11.23.1 to 13.0.2, also checked the typescript version.


  2. The error TS18003 you’re encountering ("No inputs were found in config file") typically indicates that the TypeScript compiler (tsc) did not find any TypeScript files to compile in the directories specified in the include array of your tsconfig.json file. Since your include array specifies ["src"], the compiler is expecting to find TypeScript files in the src directory.

    Here are a few steps to troubleshoot and resolve this issue:

    1. Check the src Directory: Ensure that your src directory exists at the root of your project (same level as your tsconfig.json) and that it contains TypeScript files (.ts files). If the src directory is missing or empty, or if it’s located in a different path than expected, the compiler will throw this error.

    2. File Extensions: Make sure the files in your src directory have the .ts extension and not .js. Since your tsconfig.json is set to compile TypeScript files, any JavaScript files in the src directory will not be recognized by the compiler unless allowJs is set to true in compilerOptions.

    3. Correct Path: If your TypeScript files are located in a different directory, update the include array in tsconfig.json to reflect the correct path.

    4. Cache Issues: Sometimes, build processes can have issues with caching. Clear any caches or build artifacts and try deploying again.

    5. File Permissions: Ensure that the files and directories have the correct permissions and can be accessed by the tools and processes you are using.

    6. Firebase Configuration: Double-check your Firebase configuration files (firebase.json, .firebaserc) to make sure they are correctly set up for your project structure.

    7. Restart Development Environment: Sometimes, restarting your development environment or IDE can resolve unexplained issues, especially if configuration files have been changed.

    8. Test Locally: Try running and deploying a simple test function to ensure that the problem is not with the specific function you are trying to deploy.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search