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.

Turn off esModulesInterop and allowSyntheticDefaultImports

See original GitHub issue

Describe the bug

These two typescript config option make it so that consumer must also set these settings. Read more from a core typescript member here.

After trying to speed up react-typescript-docgen I found that these two options killl typechecking performance. just these options added 15 seconds to my startup time.

Expected behavior

We don’t force consumers to use these options.

All imports of react are like

import * as React from 'react';

This is the suggested way by the core react team

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
hipstersmoothiecommented, Jun 11, 2020

I also volunteer to do this. It will probably require making a few PR to other repos.

0reactions
stale[bot]commented, Aug 2, 2020

Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TSConfig Option: esModuleInterop - TypeScript
Turning on esModuleInterop will fix both of these problems in the code transpiled by TypeScript. The first changes the behavior in the compiler, ......
Read more >
Do I ever need explicit allowSyntheticDefaultImports if ...
According to the docs you shouldn't need to specify allowSyntheticDefaultImports explicitly if you have esModuleInterop enabled, ...
Read more >
Compiler Options · typescript
For a full list of compiler options, please go to https://www.typescriptlang.org/docs/handbook/compiler-options.html. allowSyntheticDefaultImports. Allow ...
Read more >
Module can only be default-imported using esModuleInterop flag
The error "Module can only be default-imported using esModuleInterop flag" occurs when we try to import a CommonJS module into an ES6 module....
Read more >
Can anyone help me with this problem ? : r/learnjavascript
I tried these on the tsconfig file but the problem is still there :- "allowSyntheticDefaultImports": true,. "esModuleInterop": true,.
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