syncweek-react-aad / react-aad

A React wrapper for Azure AD using the Microsoft Authentication Library (MSAL). The easiest way to integrate AzureAD with your React for authentication.
MIT License
344 stars 94 forks source link

Warning: React.createElement: type is invalid -- expected a string #244

Open voloshyndmitry opened 4 years ago

voloshyndmitry commented 4 years ago

Hi All! Steps to reproduce: When I use:

"dependencies": {
    "react-aad-msal": "2.3.5",
    "react-microsoft-login": "1.8.5"
  }
import { AzureAD } from 'react-aad-msal';

in create react app (dev env) all work fine. But after build(prod env) I got:

Actual result:

Warning: React.createElement: type is invalid -- expected a string (for built-in components)
or a class/function (for composite components) but got: undefined. You likely forgot to
export your component from the file it's defined in. Check the render method of

How to fix:

import AzureAD from 'react-aad-msal';

Maybe it's not a bug. But I didn't find it in the documentation.