module has no default export

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:

has no default export.vetur(1192)

When I checked the code in the .tsx file, I saw the code like below:

import React, { Component } from 'react';
module '"http"' has no default export.

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:

>