Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
janpio opened this issue Apr 29, 2019 · 2 comments
Open

Comments

@janpio
Copy link
Member

janpio commented Apr 29, 2019

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)

@raphinesse

This comment has been minimized.

@janpio

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants