# Facebook plugin import error

**URL:** <https://community.transloadit.com/t/facebook-plugin-import-error/15149>\
**Category:** Uppy\
**Created:** [December 3, 2019, 9:18pm UTC](https://community.transloadit.com/t/facebook-plugin-import-error/15149 "2019-12-03T21:18:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alon](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@Alon](https://community.transloadit.com/u/Alon)\
**Post date:** [December 3, 2019, 9:18pm UTC](https://community.transloadit.com/t/facebook-plugin-import-error/15149/1 "2019-12-03T21:18:33Z")

</div>

Hey, I’m trying to use facebook plugin but I get the error: “Uncaught TypeError: Expected a plugin class, but got undefined. Please verify that the plugin was imported and spelled correctly.”

the steps I did were:  
changed scripts to :  
[https://transloadit.edgly.net/releases/uppy/v1.6.0/uppy.min.css](https://transloadit.edgly.net/releases/uppy/v1.6.0/uppy.min.css) and   
[https://transloadit.edgly.net/releases/uppy/v1.6.0/uppy.min.js](https://transloadit.edgly.net/releases/uppy/v1.6.0/uppy.min.js)

npm install @uppy/facebook

const uppy = Uppy.Core({…}).use(Uppy.Facebook, { target: Uppy.Dashboard, companionUrl: …})…

I will appreciate any help!

---

<div class="post-metadata">

**Author:** ![ajkachnic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/ajkachnic/32/260_2.png) [@ajkachnic](https://community.transloadit.com/u/ajkachnic)\
**Post date:** [July 8, 2020, 2:00pm UTC](https://community.transloadit.com/t/facebook-plugin-import-error/15149/2 "2020-07-08T14:00:45Z")

</div>

I know this is a late reply, but if you still have this issue, then I can probably help. If you only installed the `@uppy/facebook` package, that is your first issue. You’d also need `@uppy/core`. [The docs explain this well](https://uppy.io/docs/uppy/#Installation).

Also if you are using `@uppy/facebook`, you should be referring to the plugin by the name you imported as

**Example:**

```javascript
const Uppy = require('@uppy/core')
const Facebook = require('@uppy/facebook')

const uppy = Uppy()
uppy.use(Facebook, {
  // Options
})

```

You could also install `uppy` and use tree-shaking and ES modules. Although if you aren’t using something like [Babel](https://babeljs.io), ES modules won’t work

```javascript
import Uppy, { Facebook } from 'uppy';

const uppy = Uppy();
uppy.use(Facebook, {
  // Options
})

```

Note: The docs warn of using the `uppy` package without tree-shaking configured

> You can also use the combined `uppy` package, which includes all plugins that are maintained by the Uppy team. Only use it if you have tree-shaking set up in your module bundler, otherwise you may end up sending a lot of unused code to your users.

Based of the fact that you are coming from using the CDN, I’m assuming that you aren’t using a module bundler. Therefor, the first approach is probably the best option for you

I hope this helped. Let me know if you have any further issues or questions

- Andrew
