In this reactjs tutorial, we will discuss how to fix an error, error TS1192: Module has no default export.
error TS1192: Module has no default export
The error comes while developing a SharePoint framework crud operations using react application. When I run the below command:
gulp build
It displays an error like below:

When I checked the code in the .tsx file, I saw the code like below:
import React, { Component } from 'react';

This line was creating the issue.
Then I modified the code like below:
import * as React from 'react';
export default class CRUDReact extends React.Component<IHelloWorldProps, IStates> {
The other way you can also modify the code like the below:
import { React, Component } from 'react';
If you will write the above code, the error will not appear.
I hope this tutorial helps you to learn how to fix error, error TS1192: Module has no default export.
You can follow the same approach to solve the below error:
- has no default export.vetur(1192)
- module has no default export.vetur(1192)
- module ‘”http”‘ has no default export.
- module dotenv has no default export
- module has no default export.ts(1192)
You may also like the following tutorials:
- cannot find module jquery spfx
- The term ‘Get-MsolUser’ is not recognized as the name of a cmdlet
- no gulpfile found error in spfx
- cannot reinitialise datatable

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.