Gatsby 2.23.0 - Broken TypeScript Typings
See original GitHub issueDescription
In the latest release of Gatsby, the TypeScript typings are (still) broken. Someone made a bug report about this ~5 days ago, but changed his description later on (https://webcache.googleusercontent.com/search?q=cache:YDaF8z8bhtoJ:https://github.com/gatsbyjs/gatsby/issues/24645). This issue is now closed, but the Actual Behavior he originally explained is still present in the latest release of Gatsby.
Steps to reproduce
- Check out the Renovate Gatsby upgrade branch of my Gatsby starter (https://github.com/Tielem/gatsby-typescript-eslint-prettier-starter/tree/renovate/gatsby-monorepo)
- Run ‘npm install’
- Run ‘npm run build’
Expected Behavior
No build errors
Actual Result
Same errors as originally in the linked (now closed) ticket.
node_modules/@types/react/index.d.ts:1347:15 - error TS2320: Interface 'DOMAttributes<T>' cannot simultaneously extend types 'SxProps' and 'SxProps'.
Named property 'sx' of types 'SxProps' and 'SxProps' are not identical.
1347 interface DOMAttributes<T> {
~~~~~~~~~~~~~
node_modules/@types/react/index.d.ts:2962:19 - error TS2320: Interface 'IntrinsicAttributes' cannot simultaneously extend types 'SxProps' and 'SxProps'.
Named property 'sx' of types 'SxProps' and 'SxProps' are not identical.
2962 interface IntrinsicAttributes extends React.Attributes { }
~~~~~~~~~~~~~~~~~~~
node_modules/gatsby/index.d.ts:14:27 - error TS2307: Cannot find module './src/bootstrap/load-plugins/types' or its corresponding type declarations.
14 import { PluginRef } from "./src/bootstrap/load-plugins/types"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/theme-ui/dist/index.d.ts:6:51 - error TS7016: Could not find a declaration file for module '@theme-ui/color-modes'. '/Volumes/Workspace/project/node_modules/@theme-ui/color-modes/dist/index.js' implicitly has an 'any' type.
Try `npm install @types/theme-ui__color-modes` if it exists or add a new declaration (.d.ts) file containing `declare module '@theme-ui/color-modes';`
6 export { useColorMode, InitializeColorMode } from '@theme-ui/color-modes';
~~~~~~~~~~~~~~~~~~~~~~~
node_modules/theme-ui/dist/index.d.ts:7:36 - error TS7016: Could not find a declaration file for module '@theme-ui/mdx'. '/Volumes/Workspace/project/node_modules/@theme-ui/mdx/dist/index.js' implicitly has an 'any' type.
Try `npm install @types/theme-ui__mdx` if it exists or add a new declaration (.d.ts) file containing `declare module '@theme-ui/mdx';`
7 export { Styled, components } from '@theme-ui/mdx';
~~~~~~~~~~~~~~~
node_modules/theme-ui/dist/index.d.ts:8:31 - error TS7016: Could not find a declaration file for module '@theme-ui/theme-provider'. '/Volumes/Workspace/project/node_modules/@theme-ui/theme-provider/dist/index.js' implicitly has an 'any' type.
Try `npm install @types/theme-ui__theme-provider` if it exists or add a new declaration (.d.ts) file containing `declare module '@theme-ui/theme-provider';`
8 export { ThemeProvider } from '@theme-ui/theme-provider';
~~~~~~~~~~~~~~~~~~~~~~~~~~
Environment
Shouldn’t be relevant, fails on Netlify build and locally.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:7 (5 by maintainers)
Top Results From Across the Web
TypeScript and Gatsby
TypeScript is a JavaScript superset which extends the language to include type definitions allowing codebases to be statically checked for soundness. Gatsby ......
Read more >gatsby | Yarn - Package Manager
Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps. It combines the...
Read more >gatsby/CHANGELOG.md - UNPKG
1, # Change Log. 2. 3, All notable changes to this project will be documented in this file. 4, See [Conventional Commits](https://conventionalcommits.org) ...
Read more >node packages | Corvid by Wix
broken -link-checker. 0.7.8. available. 03/06/2022 ... @astrauka/wix-code-typescript-wrapper ... 2.23.0. available. 02/07/2021. react-native-calendar-picker.
Read more >Setting up a TypeScript and Gatsby project with GraphQL
TypeScript is a superset of JavaScript that primarily provides optional static typing, classes, and interfaces. With TypeScript, you can catch ...
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 FreeTop 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
Top GitHub Comments
So, right now the best solution is to downgrade to
v2.22.12
?The changes have not been released yet. While I pushed commit 88d5eebc317758eeab92d8c025e278115c0bb6e3, I actually aborted the publish process to npm as we were on a company-wide holiday and I didn’t want to risk breaking anything—that’s why none of the versions mentioned in the commit are on npm.