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
Typescript plugin breaks in development mode #15423
Comments
I'm also seeing this error while developing a theme. I'm also using
I'm getting this error (also have a look in the console): |
I also had this issue, I added |
I am also having this issue when creating a new gatsby project using gatsby-plugin-typescript. @gotvitch I added it |
I am also having this problem. As per @tevyt, I only encounter this when trying to use a functional component, classes appear to work fine. Adding @babel/plugin-transform-typescript does NOT work for me. |
For me, neither a functional component nor a class component works. I found out that the problem occurs only when I'm using default exports. In case of named export it works as expected. Both ways. |
I'm also having this problem. Adding @babel/plugin-transform-typescript did not solve it. |
Hmmm, it does appear to have something to do with 'default'. From what I can tell: |
Any idea when and where this issue was introduced? Rolling back gatsby and gatsby-plugin-typescript did not seem to fix it. |
I have the same problem. It was working, but since deleting the existing node_modules it doesn't. It appears that a new version of gatsby-telemetry gets installed independent of the other items. Any idea how to roll this back? Are there other programs gatsby installs without version control from package.json? |
Also having the same error with default exports as mentioned by @aemonm. Other things that I can confirm:
|
I've also noticed that, this works: export default class Page extends React.PureComponent {
render = () => (
// ...
);
}; but this doesn't: export default class extends React.PureComponent {
render = () => (
// ...
);
}; and neither does this (as mentioned by many of you above): class Page extends React.PureComponent {
render = () => (
// ...
);
};
export default Page; |
To everyone who's facing this issue and is looking for a solution, here's one workaround until this is fixed:
|
As temp workaround (if you are using
to your package.json (we can't tmp pin this in This seems like related to this issues:
seems like mix of stuff that changed in |
New release of Please try reinstalling deps (you might need to delete any lock files beforehand) and let us know if this fixes the problem. I will open PR soon to bump minimal |
Yes, works for me now 👍 |
Fixes the issue for me too |
I have recently had this issue when creating new projects via the Gatsby CLI and using the |
|
For anyone that is still having this issue, I solved it by updating gatsby to 2.24.7 in package.json |
Description
With the latest stable gatsby-plugin-typescript / gatsby i'm experiencing this error in development mode:
If I build and serve, this error does not occur.
Steps to reproduce
I made an example project https://github.com/adaptivdesign/my-hello-world-starter
I created this example from gatsby-starter-hello-world and I simply followed the instructions for gatsby-plugin-typescript. See my changes here https://github.com/adaptivdesign/my-hello-world-starter/commit/850db7bf760af8262ba707116c4c89b932b63ad1
Environment
The text was updated successfully, but these errors were encountered: