Closed iv-mexx closed 5 years ago
What was your setting to compile gatsby-browser.tsx
in gatsby 1.9.127?
gatsby-plugin-typescript
doesn't cover API files such as gatsby-config
, gatsby-browser
etc.
To use typescript on these files, you need a transpiler placed in front of gatsby
, e.g.
babel-node --presets @babel/preset-typescript --extensions '.ts,.tsx' gatsby develop
Disclaimer: I'm the author of another typescript starter (WIP) for gatsby: https://github.com/alvis/barebone-webapp
There are a few things broken at the moment, but it should work to some extent out of the box.
Honestly - I don't know how it worked before. I've used the aforementioned starter and it just worked.
I assumed that this was as intended and supported by Gatsby (or by gatsby-plugin-typescript
).
I'll checkout your starter
@iv-mexx -- were you able to resolve this?
No, that project is only semi active, and I did not have the time to look into this further. Currently, I'm still using the old version of Gatsby where this still worked.
Hiya!
This issue has gone quiet. Spooky quiet. 👻
We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
Thanks for being a part of the Gatsby community! 💪💜
Hey again!
It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY
. Please feel free to reopen this issue or create a new one if you need anything else.
Thanks again for being part of the Gatsby community!
Description
I have a fully working project using Typescript and Gatsby 1.9.127. Now I wanted to update Gatsby to the newest version (1.9.259) but after doing so,
gatsby-browser.tsx
is not compiled anymore and so my site does not work anymore.This also is the case if I use a fresh project based on this starter
Steps to reproduce
gatsby-browser.tsx
in root directorygatsby-browser.tsx
, e.g.:Expected result
gatsby-browser.tsx
should be compiled, code in the file should runActual result
gatsby-browser.tsx
is not compiled, code is not runNote
If
gatsby-browser
is not written in typescript (gatsby-browser.js
), it works as expected.Environment
npm list gatsby
): gatsby@1.9.259gatsby --version
): 1.1.20File contents (if changed):
gatsby-config.js
: no changes from starter projectpackage.json
: no changes from starter projectgatsby-node.js
: no changes from starter projectgatsby-browser.js
: changed to .tsxgatsby-browser.tsx
gatsby-ssr.js
: no changes from starter project