[1.0] gatsby-plugin-typescript fails without tsconfig.json
See original GitHub issueFrom 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
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Does Gatsby with Typescript Use tsconfig.json
1 Answer 1 · Testing frameworks like Jest will not use the internal Gatsby config and need some direction on what to do...
Read more >gatsby-plugin-typescript
Allows Gatsby to build TypeScript and TSX files. Does NOT run type checking during build (see Caveats). This plugin is automatically included in...
Read more >gatsby-plugin-atl - npm Package Health Analysis
Without these options set, there will usually be issues with the output that is fed to babel-loader , and the build will fail....
Read more >Gatsby Changelog | 5.3.0
In PR #36623 we fixed this behavior and any node changes (either by changing local files or through webhook updates) will be reflected...
Read more >duncanleung/gatsby-typescript-emotion-storybook
duncanleung/gatsby-typescript-emotion-storybook ... tsconfig.json. yarn.lock. Dependencies ... babel-plugin-module-resolver. ^4.0.0 (4.1.0).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m use to have a
tsconfig.json
so I not really aware on this issue, but I understand that It can be cool to have a default one 😃@aendrew I’m actually working on a gatsby-starter (including typescript), If you want to test/contribute, your are welcome 😃
Thanks! Though that’s been @fabien0102 who’s been tending the typescript docs.