Typescript module has no exported members - react

If anyone is still having this problem, I found that I was only exporting one item from the file so changing

export default function App() {
   ...
};

to

export function App() {
   ...
}

seemed to do the trick!


Your code should work if you fix your typo.

Instead of

import { Nodelist } from "../components/NodeList"

you should write :

import { NodeList } from "../components/NodeList"
//           ^ capital L

Another thing to check is ambiguous / similar file names.

This can also happen if you have two files in the same package whose name differs only by the extension. For example if you have

folder
      foo.tsx
      foo.ts

When you do the following import:

import { Something } from "./foo";

It will only work with items from one of the files.

The solution in this case is to rename one of the files to remove the ambiguity. Then the imports will work just fine.