TS1192

error TS1192: Module ‘json5‘ has no default export.

Broken Code ❌

1
import json5 from 'json5';

Fixed Code ✔️

When you are importing a module with built-in TypeScript declarations and TypeScript tells you that this module does not have a default export, then you can solve this problem by adding “allowSyntheticDefaultImports” to your “tsconfig.json” file and setting it to true:

tsconfig.json
1
2
3
4
5
{
"compilerOptions": {
"allowSyntheticDefaultImports": true
}
}

error TS1192: Module ‘.../logdown‘ has no default export.

Broken Code ❌

1
2
3
4
5
declare class Logdown {
// ...
}

export = Logdown;

Fixed Code ✔️

1
2
3
4
5
declare class Logdown {
// ...
}

export default Logdown;

error TS1192: ‘export *’ does not re-export a default.

Broken Code ❌

1
2
export * from './parseUrls';
export * from './runWhenReady';

You have to re-export a default (in this case coming from runWhenReady.ts):

Fixed Code ✔️

1
2
3
export * from './parseUrls';
export * from './runWhenReady';
export { default as default } from './runWhenReady';