Skip to content

[1.0] gatsby-plugin-typescript fails without tsconfig.json #840

@aendra-rininsland

Description

@aendra-rininsland

From the docs it seemed as if all that needed to be done to get gatsby-plugin-typescript working is to install the dependencies and add an entry to gatsby-config.js — however, if you don't also create a tsconfig.json file, gatsby develop throws the following:

WARNING in ./pages/index.tsx
Module build failed: error while parsing tsconfig.json
@ ./pages (coffee|cjsx|ts|tsx|jsx|js|md|rmd|mkdn?|mdwn|mdown|markdown|litcoffee|ipynb|html|json|yaml|toml)$
ERROR in error TS18002: The 'files' list in config file 'tsconfig.json' is empty.

A workaround is running: ./node_modules/.bin/tsc --init in the root of a project.

It'd be cool if one wasn't necessary and all TypeScript config could just be done in gatsby-config.js.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions