Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of `UserAlert`.

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of `UserAlert`."

are slightly cryptic. These errors can occur because of an incorrect import statement (see here) or in my case, you can make it happen in Meteor with an incorrect class definition. My issue was that:

class AccountSelector extends React.Component {... - a class declaration

needed to be:

AccountSelector = class extends React.Component {... - a class expression

The difference between a JavaScript class expression and declaration can be found here.

In my case, I am importing the class from another Meteor package so I also need to do


in my package.js file.

This problem can also happen in Meteor if you import a package that is already available:

import NotificationPreferences from './NotificationPreferences.jsx'; will result in the same error if: