by Sai gowtham

TypeScript - Solve the module has no exported member error

In this tutorial, we are going to learn about how to solve the module that has no exported member error in TypeScript.

When we try to import a member (ex: function, object etc) that doesn’t exist in the specified module, we will get the following error in our terminal.

Here is an example:

filename: maths.ts

export function add(a: number, b: number): number {
  return a + b;
}

filename: index.ts

import {division} from "./maths";

Output:

Module '"./maths"' has no exported member 'divison'.ts(2305)

In the above code, we are importing the division member in index.ts file which is not an export member of maths.ts file, so we will get the above error.

To solve this error, we need to makesure to import the member functions, objects etc which is available in the specified module with the correct names.

and also check if a member is a named export or default export.

Example of named export:

export function add(a: number, b: number): number {
  return a + b;
}

export function multiply(a: number, b: number): number {
  return a * b;
}

Example of default export:

export default checkEmpty;

Css Tutorials & Demos

How rotate an image continuously in CSS

In this demo, we are going to learn about how to rotate an image continuously using the css animations.

How to create a Instagram login Page

In this demo, i will show you how to create a instagram login page using html and css.

How to create a pulse animation in CSS

In this demo, i will show you how to create a pulse animation using css.

Creating a snowfall animation using css and JavaScript

In this demo, i will show you how to create a snow fall animation using css and JavaScript.

Top Udemy Courses

JavaScript - The Complete Guide 2022 (Beginner + Advanced)
JavaScript - The Complete Guide 2022 (Beginner + Advanced)
116,648 students enrolled
52 hours of video content
$14.99 FROM UDEMY
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
631,582 students enrolled
49 hours of video content
$24.99 FROM UDEMY
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
203,937 students enrolled
31.5 hours of video content
$14.99 FROM UDEMY