Skip to content

Compilation fails without the configuration file #1051

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
mciesin opened this issue Jan 16, 2020 · 5 comments
Closed

Compilation fails without the configuration file #1051

mciesin opened this issue Jan 16, 2020 · 5 comments
Labels

Comments

@mciesin
Copy link

mciesin commented Jan 16, 2020

Expected Behaviour

Sources should compile wihout having to define tsconfig.json file.

Actual Behaviour

They don't.

When using ts-loader without any tsconfig.json, the config defaults to:

{
    "compilerOptions": {},
    "files": []
}

which causes typescript to fail because of the empty files list. The error is very misleading though - it says:

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

yet no tsconfig.json file does exist at all. It is generated by ts-loader in case when no config is found.

Could the default config, generated by ts-loader, be changed, e.g. to config recommended in configuration section in readme?

Similar issues were raised in #405 and #434.

@stale
Copy link

stale bot commented Mar 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 16, 2020
@stale
Copy link

stale bot commented Mar 24, 2020

Closing as stale. Please reopen if you'd like to work on this further.

@stale stale bot closed this as completed Mar 24, 2020
@slinkardbrandon
Copy link

I just ran into this today as well!

@sanderlissenburg
Copy link

Yep had this misleading error (TS18002: The 'files' list in config file 'tsconfig.json' is empty) too. Turned out I had a space in front of my config file. So no tsconfig.json was found, which resulted in the default empty files array as mentioned above.

@johnnyreilly
Copy link
Member

If someone would like to raise a PR I'll take a look

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

No branches or pull requests

4 participants