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.

TS errors with styled-engine-sc and skipLibCheck: false

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Steps:

git clone https://github.com/jscheid/mui-sc-lib-check
cd mui-sc-lib-check
yarn
yarn tsc

Current behavior 😯

TS compilation errors: https://gist.github.com/jscheid/c2debf024f6683153de705520e8f5ca6

Expected behavior 🤔

No errors.

Context 🔦

This is only an issue with skipLibCheck: false in tsconfig.json. When skipping lib checks, no errors appear.

It could be something I’m doing wrong? Specifically I’m not sure about including @types/styled-components, which I didn’t see recommended anywhere. However, when I leave it out I’m getting a different set of errors.

Obviously this is easy to work around by setting skipLibCheck but I’d prefer to be able to enable these checks.

Your environment 🌎

See repo.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jscheidcommented, Oct 2, 2022

@mnajdova thanks!

@vanyaxk thanks but this issue is specifically about typings with @mui/styled-engine-sc as described here, sorry if I haven’t made that clear enough.

0reactions
jscheidcommented, Oct 14, 2022

Your documentation offers multiple different methods of installing styled-engine-sc:

  1. with Yarn
  2. with Webpack
  3. with Next.js

The example that you refer to only shows that it works with the Webpack method.

Is the Yarn method still supported? If so, there is still a bug here because when using that method you’re getting typing errors. If it’s no longer supported, it should probably be removed from the documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

skipLibCheck false resolving incorrect third party type alias ...
Currently trying to figure out why I need "skipLibCheck": true in order for compiler to resolve and emit the correct imported type alias....
Read more >
Understanding TypeScript's skipLibCheck Once and For All
When skipLibCheck is enabled, tsc will ignore all errors coming from declaration files ( d.ts ). Some types may be treated as any...
Read more >
TSConfig Option: skipLibCheck - TypeScript
A common case where you might think to use skipLibCheck is when there are two copies of a library's types in your node_modules...
Read more >
TypeScript skipLibCheck still checking node_modules libs
If I set skipLibCheck to false, and build the project, I'll have MANY more errors. So seems like the skipLibcheck works partially. Any...
Read more >
TypeScript: the skipLibCheck Option Explained
Enabling the skipLibCheck option instructs the compiler to skip type checking of all declaration ( *.d.ts ) files. This includes the *.d.ts ......
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