# Can not install plugin

**URL:** <https://phaser.discourse.group/t/can-not-install-plugin/4930>\
**Category:** Phaser 3\
**Created:** [January 18, 2020, 12:21pm UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930 "2020-01-18T12:21:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrio](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Andrio](https://phaser.discourse.group/u/Andrio)\
**Post date:** [January 18, 2020, 12:21pm UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930/1 "2020-01-18T12:21:37Z")

</div>

Hello !  
I’m very needed to install this plugin for Round Rectangle object : [https://rexrainbow.github.io/phaser3-rex-notes/docs/site/shape-roundrectangle/](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/shape-roundrectangle/)  
But all my attempts were unsuccessful.  
What i did :  
I wrote in config everything same as in example.

Here is plugin:

> <https://github.com/rexrainbow/phaser3-rex-notes/blob/master/plugins/roundrectangle-plugin.js>

I downloaded libraries and set up all paths from github , as here :

import Factory from ‘./gameobjects/shape/roundrectangle/Factory.js’;  
import Creator from ‘./gameobjects/shape/roundrectangle/Creator.js’;  
import RoundRectangle from ‘./gameobjects/shape/roundrectangle/RoundRectangle.js’;  
import SetValue from ‘./utils/object/SetValue.js’;

In my index.html i wrote this :

I’v got this mistake:

 ![](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/8/8c5271003b0422bd3ab1b6d45f1e419fa459f348.png)

Trying to solve this mistake, I downloaded from github and uploaded this file to my server :  
… utils/math/DegToRad.js but it didn’t help

May be somewhere have examples how to install plugins from github ?

Please help me ! I desperately need this plugin !

---

<div class="post-metadata">

**Author:** ![Nemesis](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@Nemesis](https://phaser.discourse.group/u/Nemesis)\
**Post date:** [January 18, 2020, 1:46pm UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930/2 "2020-01-18T13:46:46Z")

</div>

Are you using webpack? @Andrio

---

<div class="post-metadata">

**Author:** ![piratepablo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/piratepablo/32/2590_2.png) [@piratepablo](https://phaser.discourse.group/u/piratepablo)\
**Post date:** [January 18, 2020, 2:04pm UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930/3 "2020-01-18T14:04:11Z")

</div>

Copy the minified version to a folder on your project. Here is the link: [https://github.com/rexrainbow/phaser3-rex-notes/blob/master/dist/rexroundrectangleplugin.min.js](https://github.com/rexrainbow/phaser3-rex-notes/blob/master/dist/rexroundrectangleplugin.min.js)

Import that file to your config file. Then add it to the config:

```javascript
Import RoundRectanglePlugin from 'rexroundrectangleplugin.min'

var config = {
    // ...
    plugins: {
        global: [{
            key: 'rexRoundRectanglePlugin',
            plugin: RoundRectanglePlugin,
            start: true
        },
        // ...
        ]
    }
    // ...
};
var game = new Phaser.Game(config);

```

---

<div class="post-metadata">

**Author:** ![Andrio](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Andrio](https://phaser.discourse.group/u/Andrio)\
**Post date:** [January 18, 2020, 3:04pm UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930/4 "2020-01-18T15:04:00Z")

</div>

[piratepablo](https://phaser.discourse.group/u/piratepablo)  
Thanks, i did what you said but have error:  
“Uncaught SyntaxError: Cannot use import statement outside a module”

I think i need write it like this :

```
 < script src="phaser.min.js"></script>
 < script src="rexroundrectangleplugin.min.js"></script>

```

After this, I have diffrenet error :  
 ![](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/2/2d4de8bc7fd04230ad55d112afe3d999be95c66d.png)

I even installed “phaser3-rex-plugins” with this command “npm install phaser3-rex-plugins”  
and then wrote direct path to file and have same error .

[Nemesis](https://phaser.discourse.group/u/Nemesis)

No , I doesn’t use webpack.

---

<div class="post-metadata">

**Author:** ![Andrio](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Andrio](https://phaser.discourse.group/u/Andrio)\
**Post date:** [January 18, 2020, 4:38pm UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930/5 "2020-01-18T16:38:24Z")

</div>

```
<script type="module"> 

  import { RoundRectanglePlugin } from "/phaser3-rex-plugins/plugins/roundrectangle-plugin.js"; 

  console.log ("RoundRectanglePlugin == " , RoundRectanglePlugin )

   </script>

```

This script gives such error :  
Uncaught SyntaxError: The requested module ‘…/…/…/utils/math/DegToRad.js’ does not provide an export named ‘default’

Same error with :  
import { RoundRectanglePlugin } from “/rexroundrectangleplugin.min.js”;

---

<div class="post-metadata">

**Author:** ![Nemesis](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@Nemesis](https://phaser.discourse.group/u/Nemesis)\
**Post date:** [January 18, 2020, 5:05pm UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930/6 "2020-01-18T17:05:32Z")

</div>

I think that you might use the plugin in a different way because Rex said in a post that the import from method works only with webpack.  
[RexRainbow Round Rectangle Plugin](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/shape-roundrectangle/#install-plugin)  
You must try using the plugin from the game config.  
I’m not totally sure, but it can help  
Here is the post -  
[How to install a plugin(Board plugin from Rex)](https://phaser.discourse.group/t/how-to-use-plugins-board-plugin-by-rex/3256/4)

---

<div class="post-metadata">

**Author:** ![rexrainbow](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/rexrainbow/32/51_2.png) [@rexrainbow](https://phaser.discourse.group/u/rexrainbow)\
**Post date:** [January 18, 2020, 6:29pm UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930/7 "2020-01-18T18:29:49Z")

</div>

Thanks for this suggestion, I will try to add more instructions of installing plugin.

---

<div class="post-metadata">

**Author:** ![Andrio](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Andrio](https://phaser.discourse.group/u/Andrio)\
**Post date:** [January 18, 2020, 6:59pm UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930/8 "2020-01-18T18:59:29Z")

</div>

Thanks, but what should i write in code if I want use webpack? Now I just installed webpack, and don’t know how to use. Or is it possibly to run plugin without webpack ?

---

<div class="post-metadata">

**Author:** ![piratepablo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/piratepablo/32/2590_2.png) [@piratepablo](https://phaser.discourse.group/u/piratepablo)\
**Post date:** [January 18, 2020, 11:45pm UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930/9 "2020-01-18T23:45:56Z")

</div>

I recommend this project to use a modular project with webpack [https://github.com/lean/phaser-es6-webpack](https://github.com/lean/phaser-es6-webpack)

---

<div class="post-metadata">

**Author:** ![rexrainbow](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/rexrainbow/32/51_2.png) [@rexrainbow](https://phaser.discourse.group/u/rexrainbow)\
**Post date:** [February 4, 2020, 6:50am UTC](https://phaser.discourse.group/t/can-not-install-plugin/4930/10 "2020-02-04T06:50:38Z")

</div>

Added install instructions in each plugin.  
[Here](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/shape-roundrectangle/#import-plugin) is an install instructions of round-rectangle game object, with `import` and webpack.
