Skip to content

plugman platform add --platform_name windows generates crashing default #122

@janpio

Description

@janpio
plugman create --name cordova-plugin-math --plugin_id cordova-plugin-math --plugin_version 0.0.1
plugman platform add --platform_name windows

leads to

    <js-module name="cordova-plugin-math" src="www/cordova-plugin-math.js">
        <clobbers target="cordova.plugins.math" />
    </js-module>
    <platform name="windows">
        <js-module name="cordova-plugin-math" src="src/windows/cordova-plugin-math.js">
            <runs target="" />
        </js-module>
    </platform>

Those files being named identical, leads to this exception:

image

SCRIPT5022: Unhandled exception at line 74, column 13 in ms-appx-web://io.cordova.hellocordova/www/cordova.js
0x800a139e - JavaScript runtime error: module cordova-plugin-math.cordova-plugin-math already defined

because both files begin with

cordova.define("cordova-plugin-math.cordova-plugin-math", function(require, exports, module) {

Updating js-module.name to mathProxy (and renaming src/windows/cordova-plugin-math.js to src/windows/mathProxy.js and updating the .src to that) fixes the problem. (Might have to remove and re-add the platform to get rid o the old file though)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions