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

cordova-plugin-ace doesn't work in 1.3 beta 11 #6356

Closed
bwhitty opened this issue Feb 27, 2016 · 12 comments
Closed

cordova-plugin-ace doesn't work in 1.3 beta 11 #6356

bwhitty opened this issue Feb 27, 2016 · 12 comments
Assignees

Comments

@bwhitty
Copy link
Contributor

bwhitty commented Feb 27, 2016

First asked here https://forums.meteor.com/t/assistance-integrating-microsoft-project-ace-w-meteor-1-3-cordova.

Currently I've tried this (on a new 1.3-beta.11 app)

meteor add cordova:cordova-plugin-ace@0.0.12

I then added a simple top-level file called test-ace.js

Meteor.startup(() => {
  if (Meteor.isCordova) {
    console.log('on cordova! ace?', ace);
  }
});

Running this via

meteor run ios-device

And debugging it via Safari it just throws a type error that ace is undefined.

I can confirm that the plugin is defined and usable when using 1.2.1

@martijnwalraven
Copy link
Contributor

It seems cordova-plugin-ace may not be compatible yet with the Cordova and platform versions used with Meteor 1.3. In beta.11, we're using Cordova 6.0.0, Cordova iOS 4.0.1 and Cordova Android 5.1.0.

I haven't been able to successfully install the plugin either with Meteor or in a plain Cordova project. This is the result I get using cordova directly:

➜  cordovaapp cordova platform add ios
Adding ios project...
iOS project created with cordova-ios@4.0.1
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for ios
➜  cordovaapp cordova plugin add cordova-plugin-ace
Fetching plugin "cordova-plugin-ace" via npm
Installing "cordova-plugin-ace" for ios
Failed to install 'cordova-plugin-ace':TypeError: Uh oh!
Object #<Object> has no method 'parse'
    at handlers.js-module.install (/Users/martijnwalraven/Development/playpen/cordovaapp/platforms/ios/cordova/lib/plugman/pluginHandlers.js:156:66)
    at Object.ActionStack.process (/Users/martijnwalraven/Development/playpen/cordovaapp/platforms/ios/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
    at Plugman.addPlugin (/Users/martijnwalraven/Development/playpen/cordovaapp/platforms/ios/cordova/lib/plugman/Plugman.js:82:20)
    at Api.addPlugin (/Users/martijnwalraven/Development/playpen/cordovaapp/platforms/ios/cordova/Api.js:187:53)
    at handleInstall (/Users/martijnwalraven/.nvm/v0.10.41/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:601:6)
    at /Users/martijnwalraven/.nvm/v0.10.41/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:385:28
    at _fulfilled (/Users/martijnwalraven/.nvm/v0.10.41/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/Users/martijnwalraven/.nvm/v0.10.41/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/Users/martijnwalraven/.nvm/v0.10.41/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /Users/martijnwalraven/.nvm/v0.10.41/lib/node_modules/cordova/node_modules/q/q.js:509:49
Error: Uh oh!
Object #<Object> has no method 'parse'
➜  cordovaapp 

So this doesn't seem like something we can fix in Meteor, and you should probably open an issue in the cordova-plugin-ace repository.

@martijnwalraven martijnwalraven self-assigned this Feb 27, 2016
@martijnwalraven martijnwalraven changed the title 3rd party Cordova plugin undefined using 1.3 beta 11 cordova-plugin-ace doesn't work in 1.3 beta 11 Feb 27, 2016
@bwhitty
Copy link
Contributor Author

bwhitty commented Feb 27, 2016

Alright, I did see that same error when I first used the plugin on 1.3, but the second time I tried the app launched without error so I just thought some one-off error happened initially. Could this be the new auto-rollback feature?

[11:05 PM]-[Brady@Bradens-MacBook-Pro]-[~/dev/meteor/test-app]
$ meteor run ios --port 4000
[[[[[ ~/dev/meteor/test-app ]]]]]

=> Started proxy.
% Failed to install 'cordova-plugin-ace':TypeError: Uh oh!
Object [object Object] has no method 'parse'
    at handlers.js-module.install (/path/dev/meteor/test-app)
...
(more stack trace here)
...

[11:05 PM]-[Brady@Bradens-MacBook-Pro]-[~/dev/meteor/test-app]
$ meteor run ios --port 4000
[[[[[ ~/dev/meteor/test-app ]]]]]

=> Started proxy.
=> Started MongoDB.
npm WARN deprecated lodash-node@2.4.1: This package has been discontinued in favor of lodash@^4.0.0.
fs-extra@0.26.5 ../../../node_modules/fs-extra
├── path-is-absolute@1.0.0
├── klaw@1.1.3
├── jsonfile@2.2.3
├── graceful-fs@4.1.3
└── rimraf@2.5.2 (glob@7.0.0)

xcode@0.8.3 ../../../node_modules/xcode
├── node-uuid@1.3.3
├── pegjs@0.6.2
└── simple-plist@0.0.4 (bplist-parser@0.0.6, bplist-creator@0.0.4, plist@1.1.0)
=> Started your app.

=> App running at: http://localhost:4000/
=> Started app on iOS Simulator.
=> Meteor server restarted^C

@martijnwalraven
Copy link
Contributor

No, the rollback only applies to code downloaded to the client. This is an issue with plugin installation, maybe one of the installation hooks generates errors on this version of Cordova. The plugin not installing would also explain why it is undefined at run time.

@bwhitty
Copy link
Contributor Author

bwhitty commented Feb 27, 2016

Cool, understood now. I'll see what I can dig up for this plugin Cordova version compatibility-wise.

@krishnaff
Copy link

Similar problem with https://www.npmjs.com/package/cordova-plugin-fetch
While adding plugin cordova-fetch-plugin@1.0.0 to Cordova project: Cordova error: Failed to fetch plugin cordova-fetch-plugin@1.0.0 via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Error: Registry returned 404 for GET on https://registry.npmjs.org/cordova-fetch-plugin at registry.fetch.fail.then.pinfo

Tried adding this way
meteor add cordova:cordova-plugin-fetch@1.0.0
Does not work at all

And also as a local package by downloading the repo and
meteor add cordova:file://....path
Throws errors about missing files.

Any workaround for this please? Thanks.

@martijnwalraven
Copy link
Contributor

@insaneinc01: That error message seems to suggest it is trying to add cordova-fetch-plugin instead of cordova-plugin-fetch.

That doesn't explain the build error you mention in the linked issue however, so there might indeed be a compatibility issue.

@krishnaff
Copy link

hello @martijnwalraven
My bad! thats a typo.
Its actually
meteor add cordova:cordova-fetch-plugin@1.0.0

So yes its a compatibility issue I guess. Which is bad, had to get back to Meteor 1.2 for now :(

@camrongodbout
Copy link

@martijnwalraven I just tested out cordova@6.0.0 with cordova platform add ios@4.0.1 --save then tried cordova plugin add cordova-plugin-ace which is what you said earlier in the thread we are using for meteor 1.3 beta. This worked. I'm now on 1.3 normal but meteor add cordova:cordoba-plugin-ace@0.0.14 does not work. With the same error as before with there is no method 'parse'

@camrongodbout
Copy link

Also this is specifically a meteor issue when installing a package because some more testing

If I cd into the ~/meteor_project/.meteor/local/cordova-build/ and cordova plugin add cordova-plugin-ace the package installs and I can cordova run ios and everything works fine.

@martijnwalraven
Copy link
Contributor

I looked into this some more, and the issue seems to occur because cordova-plugin-ace uses path.parse(), which was only added in Node 0.12. Because Meteor runs in Node 0.10, this won't work until we upgrade the included Node version (which is next on the roadmap).

Until then, running cordova plugin add cordova-plugin-ace manually in the cordova-build directory is the only workaround, but you may have to do this again when the project is regenerated or when Meteor reinstalls the plugins (which happens every time you add/remove another plugin).

When I tried cordova plugin add cordova-plugin-ace before, I also had Node 0.10 installed, so that explains why I got the same error.

@AndyHan1001
Copy link

I've got the same issue when using cordova-plugin-app-version plugin. Is this a bug in meteor 1.3.2.4?

@abernix
Copy link
Contributor

abernix commented May 17, 2016

@AndyHan1001 Did you see what @martijnwalraven wrote above?

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

No branches or pull requests

6 participants