Trouble with a plugin

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:

        .plugin('aurelia-google-maps', (config: any) => {
                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 (
                language: 'en', // default: uses browser configuration (recommended). Set this parameter to set another language (
                region: 'US', // default: it applies a default bias for application behavior towards the United States. (
                markerCluster: {
                    enable: false,
                    src: '', // self-hosting this file is highly recommended. (
                    imagePath: '', // 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. (
                    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?

Try wrapping it in PLATFORM.moduleName, for example:

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

Yep same like here 0.33.1 - webpack - config.globalResources not working

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


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

@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.

@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.

1 Like