microlinkhq / sdk

Make any URL embeddable. Turn any URL into a beautiful link preview.

Home Page:https://microlink.io/sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught Error: Element 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.

anthonylebrun opened this issue · comments

I'm having trouble importing this as an ES6 module and getting the following error message:

invariant.js:46 Uncaught Error: Element 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.

I installed the package via

npm install react-microlink styled-components --save

And am importing the package via

import MicrolinkCard from "react-microlink"

I'm building the project using brunch with the following config (this is in a Elixir/Phoenix project):

  plugins: {
    babel: {
      presets: ["es2015", "stage-3", "react"],
      // Do not use ES6 compiler in vendor code
      ignore: [/vendor/]
    },
    copycat: {
      fonts: [
        "vendor/font-awesome/fonts"
      ]
    },
    sass: {
      // Enable SASS/SCSS support
      mode: "native",
      options: {
        includePaths: [
          "node_modules"
        ]
      }
    }
  },

I'm guessing there's a good chance that it's my setup that is broken but I haven't had any trouble installing and importing other npm ES6 compatible packages.

Any thoughts?

Can you try it from a create-react-app from the scratch?

Could be easier to detect if the problem is actually your scaffolding setup

I realized after posting this that microlinkhq depends on react >= 16 and I'm using react 15. I guess my issue is moot.