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.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
fabien0102commented, Apr 23, 2017

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 😃

0reactions
KyleAMathewscommented, Apr 27, 2017

Thanks! Though that’s been @fabien0102 who’s been tending the typescript docs.

Read more comments on GitHub >

github_iconTop 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 >

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