error TS1192: Module '" A.module"' has no default export

Use:

import { Module } from 'module';

You need to insert the module name between {...}


For me this issue was addressed using "allowSyntheticDefaultImports": true within compilerOptions in the project's tsconfig.json.

Our specific error related to a moment js import.

More about this option can be found here


Accepted answer didn't work for me, so I am posting more info.

I had:

import Module from 'module';

and this worked for me:

import * as Module from 'module';

src: https://github.com/Microsoft/TypeScript/issues/3337#issuecomment-107971371


This was a simple error. It occurred due to the missing {} around the module name in the import statement itself. Since this killed 2-3 hours of my time, sharing with you all so you won't waste yours. Hope this can help someone. Cheers, Abhi.