@material-ui/styled-engine-sc fails TypeScript build with skipLibCheck: false
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
When running tsc, the following errors come up:
node_modules/@material-ui/styled-engine/GlobalStyles/GlobalStyles.d.ts:2:31 - error TS2307: Cannot find module '@emotion/styled' or its corresponding type declarations.
2 import { Interpolation } from '@emotion/styled';
~~~~~~~~~~~~~~~~~
node_modules/@material-ui/styled-engine/index.d.ts:1:15 - error TS2307: Cannot find module '@emotion/styled' or its corresponding type declarations.
1 export * from '@emotion/styled';
~~~~~~~~~~~~~~~~~
node_modules/@material-ui/styled-engine/index.d.ts:2:25 - error TS2307: Cannot find module '@emotion/styled' or its corresponding type declarations.
2 export { default } from '@emotion/styled';
~~~~~~~~~~~~~~~~~
node_modules/@material-ui/styled-engine/index.d.ts:3:46 - error TS2307: Cannot find module '@emotion/react' or its corresponding type declarations.
3 export { ThemeContext, keyframes, css } from '@emotion/react';
Expected Behavior 🤔
Compile without errors
Steps to Reproduce 🕹
Here’s a repo that’s TS version of the example repo provided for styled-components interoperability: https://github.com/jqrun/create-react-app-with-styled-components
Steps:
- npm install
- npm run tsc
Context 🔦
Your Environment 🌎
`npx @material-ui/envinfo`
System:
OS: macOS 11.2.3
Binaries:
Node: 15.0.1 - ~/.nvm/versions/node/v15.0.1/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.5.2 - ~/.nvm/versions/node/v15.0.1/bin/npm
Browsers:
Chrome: 89.0.4389.114
Edge: Not Found
Firefox: Not Found
Safari: 14.0.3
npmPackages:
@material-ui/core: next => 5.0.0-alpha.29
@material-ui/lab: next => 5.0.0-alpha.29
@material-ui/styled-engine: 5.0.0-alpha.25
@material-ui/styled-engine-sc: next => 5.0.0-alpha.25
@material-ui/styles: 5.0.0-alpha.29
@material-ui/system: 5.0.0-alpha.29
@material-ui/types: 5.1.7
@material-ui/unstyled: 5.0.0-alpha.29
@material-ui/utils: 5.0.0-alpha.29
@types/react: ^17.0.3 => 17.0.3
react: latest => 17.0.2
react-dom: latest => 17.0.2
styled-components: latest => 5.2.3
typescript: ^4.2.3 => 4.2.3
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Fails typescript build with `skipLibCheck: false` as of ... - GitHub
As of typescript@4.4.2 , projects with the skipLibCheck option disabled will see errors when running tsc with reakit as a dependency.
Read more >Understanding TypeScript's skipLibCheck Once and For All
By default (when skipLibCheck is false), tsc will fail to compile such an error. It doesn't matter if the file is in node_modules...
Read more >TSConfig Option: skipLibCheck - TypeScript
TSConfig. skipLibCheck. Skip type checking of declaration files. This can save time during compilation at the expense of type-system accuracy.
Read more >TypeScript skipLibCheck still checking node_modules libs
skipLibCheck is not meant to prevent all type checking in node_modules. Although it may work for some projects, but it's just a coincidence....
Read more >TypeScript: the skipLibCheck Option Explained
--skipLibCheck forces the compiler to skip type checking all declaration files. Commonly, a program includes many dependencies, ...
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
@mnajdova Sounds great
@jqrun great! @oliviertassinari do you think it would be helpful if we include an example of
styled-components
+TypeScript
? @jqrun would you be interested in adding it in ourexamples
?