question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Still getting issue "TS18003: No inputs were found in config file 'tsconfig.json'"

See original GitHub issue

Hi,

I am currently building a more-or-less zero config bundler for our company’s internal usage. For this I want to add TypeScript support using ts-loader without needing any of our dozens of projects to add a tsconfig.json.

Expected Behaviour

It should just work, as there is an option in the plugin to set a custom path for the tsconfig.json.

Actual Behaviour

It doesn’t work and errors out with

TS18003: No inputs were found in config file ‘tsconfig.json’. Specified ‘include’ paths were ‘[“**/*”]’ and ‘exclude’ paths were ‘[]’.

Steps to Reproduce the Problem

I installed your vanilla example and did the following adjustments:

  • move tsconfig.json to example/tsconfig.json

  • change the webpack config to point to the new config file:

    module: {
        rules: [
            {
                test: /\.tsx?$/,
                loader: 'ts-loader',
                options: {
                    configFile: __dirname + "/test/tsconfig.json" // <- this is new
                }
            }
        ]
    },
    

Location of a Minimal Repository that Demonstrates the Issue.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
apfelboxcommented, Feb 28, 2018

@johnnyreilly it actually worked using context, thank you! I was already desparate, as nothing seemed to work. Thank you very much for the fast answer! I will send a PR though, to suggest an improvement in the docs.

@theironcook I think you have an other issue, I think you are using invalid babel loader syntax. There are two variations (there are actually more, but two that matter):

  1. with a single loader
{
    test: /\.ts?$/, 
    loader: 'ts-loader', 
    exclude: /node_modules/, 
    options: { 
        context: __dirname, 
        configFile: 'tsconfig.client.json' 
    },
}

or 2) with a list of loaders:

{
    test: /\.ts?$/, 
    exclude: /node_modules/, 
    use: [
        {
            loader: 'ts-loader', 
            options: { 
                context: __dirname, 
                configFile: 'tsconfig.client.json' 
            },
        }
    ]
}

You have a mix of both, but need to use loader as key. That is what the error message is trying to tell you, they literally mean the object key loader in

options / query provided without loader

0reactions
apfelboxcommented, Feb 28, 2018

I will close this issue, as we now have an open PR to keep the discussion going in #733

Read more comments on GitHub >

github_iconTop Results From Across the Web

tsconfig.json: Build:No inputs were found in config file
I have an ASP.NET core project and I'm getting this error when I try to build it: error TS18003: Build:No inputs were found...
Read more >
error TS18003: No inputs were found in config file 'tsconfig ...
can't parsing tsconfig.json error TS18003: No inputs were found in config file ... I am getting the same error I also have .ts...
Read more >
No inputs were found in config file in TypeScript | bobbyhadz
The error "No inputs were found in config file" occurs when we try to build a project that does not contain any TypeScript...
Read more >
tsconfig.json: Build:No inputs were found in config file
I have an ASP.NET core project and I'm getting this error when I try to build it: error TS18003: Build:No inputs were found...
Read more >
tsconfig.json: Build:No inputs were found in config file - iTecNote
I have an ASP.NET core project and I'm getting this error when I try to build it: error TS18003: Build:No inputs were found...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found