React Error: Attempted import error ‘X’ is not exported from

This error occurs when you try to import something that is not present in the specified file. When solving this error, check to make sure you are using the corresponding import and export mechanisms.

Default exports

Default exports are useful to export only a single object, function, variable. You can have only one default export per file.  

How to make a default export:

export default function Component() {
   return <h1>Hello, world</h1>

How to import a component with a default export:

import Component from './Component';

Notice that you do not use curly braces when importing a default export.

When importing a default export, you can use any name you want since there is only one in the file. For example:

import MyNewName from './Component';

Named import

You can have more than one named exports per file.

How to make a named export:

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

export function subtract(a, b) {
    return a - b;

How to export multiple named modules at once:

export {

How to import a named export:

import { add, subtract } from './another-file';

When using named imports, the name of imported module must be the same as the name of the exported module.

You can also import both a default module and a named module on the same line, like so:

import Component, { add } from './another-file';

TypeScript Error: Generic type ‘Array’ requires 1 type argument(s).

This error comes from the use of Array without any type for the elements in the array. To solve this error, define a type for the contents of the array. You can define this in 2 different ways:

Solution 1:

clients: String[];

Solution 2:

clients: Array<String>;

If the type of the array can’t be determined, use any:


Note: Using the T[] syntax is recommended over Array<T> syntax

Remix IDE Alert: This contract may… not invoke an inherited contact’s constructor correctly

The Alert

I just tried deploying a contract on Remix IDE, then got this alert:

This contract may be abstract, not implement an abstract parent’s methods completely or not invoke an inherited contract’s constructor correctly.

Here is a screenshot:


In my case, the problem was that I had the wrong contract selected (lol)! Make sure you have the right contract selected