Skip to content

error TS18002 when tsconfig.json is not found #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vivekkpai opened this issue Dec 30, 2016 · 2 comments
Closed

error TS18002 when tsconfig.json is not found #434

vivekkpai opened this issue Dec 30, 2016 · 2 comments

Comments

@vivekkpai
Copy link

In my build scenario, all compilerOptions are passed within the Webpack configuration. There are no tsconfig.json files anywhere in the source tree. Webpack configuration files are generatedon-the-fly based on information in a project repository (a database).

While this used to work with [email protected] and [email protected], it no longer does with [email protected]. Now ts-loader terminates with error:

error TS18002: The 'files' list in config file 'tsconfig.json' is empty

I tried the following combinations:

[email protected] and [email protected] // <- Fails!
[email protected] and [email protected] // <- Fails!
[email protected] and [email protected] // <- Works!!

The error seems to arise from an empty configuration that is created (in config.js line 46). For some reason, this results in an error with compiler.parseJsonConfigFileContent (config.js line 99). I didn't investigate further into the typescript compiler to see why this is the case. I also don't see changes with respect to 1.2.2 which might cause this.

A small change seems to fix this:
//config.ts line 46
configFile = {
config: {
compilerOptions: {},
// files: [], // As it exists in the repo as of 1.3.3
files: [ loader.resourcePath ] // Line changed to add current resource path
},
};

A bug or by-design?

@johnnyreilly
Copy link
Member

This was a change in TypeScript 2.1 - nothing to do with ts-loader I'm afraid. See microsoft/TypeScript#11834 for details

@elsassph
Copy link

elsassph commented Feb 1, 2017

Sorry but concretely, is there a workaround besides going back TS 2.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants