# Trouble with a plugin

**URL:** <https://discourse.aurelia.io/t/trouble-with-a-plugin/937>\
**Category:** Help Requests\
**Created:** [March 20, 2018, 8:55pm UTC](https://discourse.aurelia.io/t/trouble-with-a-plugin/937 "2018-03-20T20:55:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgroves](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/mgroves/32/670_2.png) [@mgroves](https://discourse.aurelia.io/u/mgroves)\
**Post date:** [March 20, 2018, 8:55pm UTC](https://discourse.aurelia.io/t/trouble-with-a-plugin/937/1 "2018-03-20T20:55:00Z")

</div>

I created an aurelia project with “dotnet new aurelia”.

I’m trying to use the aurelia -google-maps plugin, I followed the directions here to make changes to boot.ts: [https://www.npmjs.com/package/aurelia-google-maps](https://www.npmjs.com/package/aurelia-google-maps)

```
    aurelia.use
        .plugin('aurelia-google-maps', (config: any) => {
            config.options({
                apiKey: false, // use `false` to disable the key
                apiLibraries: 'drawing,geometry', //get optional libraries like drawing, geometry, ... - comma seperated list
                options: { panControl: true, panControlOptions: { position: 9 } }, //add google.maps.MapOptions on construct (https://developers.google.com/maps/documentation/javascript/3.exp/reference#MapOptions)
                language: 'en', // default: uses browser configuration (recommended). Set this parameter to set another language (https://developers.google.com/maps/documentation/javascript/localization)
                region: 'US', // default: it applies a default bias for application behavior towards the United States. (https://developers.google.com/maps/documentation/javascript/localization)
                markerCluster: {
                    enable: false,
                    src: 'https://cdn.rawgit.com/googlemaps/v3-utility-library/99a385c1/markerclusterer/src/markerclusterer.js', // self-hosting this file is highly recommended. (https://developers.google.com/maps/documentation/javascript/marker-clustering)
                    imagePath: 'https://cdn.rawgit.com/googlemaps/v3-utility-library/tree/master/markerclusterer/images/m', // the base URL where the images representing the clusters will be found. The full URL will be: `{imagePath}{[1-5]}`.`{imageExtension}` e.g. `foo/1.png`. Self-hosting these images is highly recommended. (https://developers.google.com/maps/documentation/javascript/marker-clustering)
                    imageExtension: 'png',
                }
            });
        });

```

I’m getting an error “Unable to find module with ID: aurelia-google-maps”.

What am I missing? Is this a problem with the plugin or am I doing something wrong with aurelia?

---

<div class="post-metadata">

**Author:** ![michaelbull](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/michaelbull/32/671_2.png) [@michaelbull](https://discourse.aurelia.io/u/michaelbull)\
**Post date:** [March 20, 2018, 8:56pm UTC](https://discourse.aurelia.io/t/trouble-with-a-plugin/937/2 "2018-03-20T20:56:00Z")

</div>

Try wrapping it in `PLATFORM.moduleName`, for example:

```auto
aurelia.use.plugin(PLATFORM.moduleName('aurelia-google-maps'), ...)

```

---

<div class="post-metadata">

**Author:** ![zewa666](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/zewa666/32/19_2.png) [@zewa666](https://discourse.aurelia.io/u/zewa666)\
**Post date:** [March 20, 2018, 8:56pm UTC](https://discourse.aurelia.io/t/trouble-with-a-plugin/937/3 "2018-03-20T20:56:39Z")

</div>

Yep same like here [0.33.1 - webpack - config.globalResources not working](https://discourse.aurelia.io/t/0-33-1-webpack-config-globalresources-not-working/934/2)

---

<div class="post-metadata">

**Author:** ![mgroves](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/mgroves/32/670_2.png) [@mgroves](https://discourse.aurelia.io/u/mgroves)\
**Post date:** [March 20, 2018, 9:28pm UTC](https://discourse.aurelia.io/t/trouble-with-a-plugin/937/4 "2018-03-20T21:28:44Z")

</div>

Cool, that works. _Why_ does that work? What is PLATFORM.moduleName doing?

---

<div class="post-metadata">

**Author:** ![HamedFathi](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/hamedfathi/32/2099_2.png) [@HamedFathi](https://discourse.aurelia.io/u/HamedFathi)\
**Post date:** [March 20, 2018, 9:41pm UTC](https://discourse.aurelia.io/t/trouble-with-a-plugin/937/5 "2018-03-20T21:41:51Z")

</div>

@mgroves

When you use `webpack ` you should use `PLATFORM.moduleName`. See the following link

> **[aurelia/webpack-plugin](https://github.com/aurelia/webpack-plugin/wiki/Managing-dependencies)**
>
> A plugin for webpack that enables bundling Aurelia applications. - aurelia/webpack-plugin

---

<div class="post-metadata">

**Author:** ![dwaynecharrington](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/dwaynecharrington/32/11_2.png) [@dwaynecharrington](https://discourse.aurelia.io/u/dwaynecharrington)\
**Post date:** [March 20, 2018, 11:08pm UTC](https://discourse.aurelia.io/t/trouble-with-a-plugin/937/6 "2018-03-20T23:08:15Z")

</div>

@michaelbull kindly addressed this in the plugin README which has been merged in. I am about to do a release which also has some other pull requests added in as well.

---

<div class="post-metadata">

**Author:** ![fkleuver](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/fkleuver/32/994_2.png) [@fkleuver](https://discourse.aurelia.io/u/fkleuver)\
**Post date:** [March 21, 2018, 9:09pm UTC](https://discourse.aurelia.io/t/trouble-with-a-plugin/937/7 "2018-03-21T21:09:38Z")

</div>

@mgroves The reason _why_ that works is because `aurelia-webpack-loader` statically analyzes all your project files and looks for the magic string “PLATFORM.moduleName”, then extracts the text content of that call and passes that to webpack to make sure it includes the file in the build.
