-
Notifications
You must be signed in to change notification settings - Fork 110
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
Support cordova-cli 9.0.0 - requireCordovaModule deprecation #56
Comments
manually changing |
@lrbalt The problem is encountered when the new [email protected] version does not support the required file upload through that command. Just go to "Projectroot\plugins\cordova-plugin-add-swift-support" and open the file add-Swift-support. js replacing the old command: "context. requireCordovaModule" with-> require I also found that on the line: -> 12920: var cordovaUtil = context. requireCordovaModule (' Cordova-lib/src/Cordova/util '); While changing the method as shown above, the CLI of Cordoba returns an error. I reset the old variable and added the iOS platform again. It worked For me. |
I'm currently working on a PR to update fix this issue (and to update the dependencies and drop webpack) Edit: #57 |
Hello guys, Thanks a lot for you PR @timbru31, I'm not working on a Cordova project anymore at the moment so it's really appreciated to have this kind of PR. I will have a look on it this week. |
@akofman Yup, I'll give it a try when I return to work tomorrow 👍 |
changing all requireCordovaModule with plain require works. I made a typo, so forget about the other error I reported. |
I just used PR #57 and my app compiles with latest xcode. I needed to manually set minimum swift version to 4, but I don't know if this plugins depends on swift 3 or another one. I'm in favor of merging |
@lrbalt you should be able to configure this version using |
I do not have this preference in my I think it is set in the xcode-config if nothing is defined anywhere. I think it is set to 3 on line 148 of |
Yeah you have to add the config setting yourself ;)
I could update my PR to make Swift 4 the new default, since its already introducing breaking changes.
…Sent from my iPhone
On 28. Mar 2019, at 11:53 AM, Reinier Balt ***@***.***> wrote:
I do not have this preference in my config.xml, but I edited it in Xcode. That works.
I think it is set in the xcode-config if nothing is defined anywhere. I think it is set to 3 on line 148 of add-swift-support.js (the one of PR #57). Perhaps it should be changed to 4 since Xcode 10.2 does not support 3 anymore?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Could you provide me some guidance? I've cloned timbru31's fix, how can I replace the old cordova plugin with the impromptu code? e.g.: someone else clones my repo, they don't have my node_modules so... how can they get the code fix? |
AFAICS, two options:
The third option is wait for #57 to be merged of course :-) When everything is merged, you may need to remove the changed plugin and reinstall the official updated plugin |
Thanks @lrbalt ! |
please note that if you manually changed the plugin, it will not be removed using also, I needed to rebuild the ios workspace by |
As mentioned on this Issue, I'm still having problem with this requireCordovaModule. Am I the only one? |
How do I access module.exports = function (context) {
console.log(context.hook)
var q = context.requireCordovaModule('q') // does not work
var q = context.q // does not work
var q = context.require('q') // does not work
var q = context.cordova.require('q') // does not work
} Or shall I simply ignore the context altogether in the hooks? module.exports = function (context) {
console.log(context.hook)
var q = require('q') // this works, but what about the context?
} |
The use of
context.requireCordovaModule
for non-cordova dependencies has been removed, and suggests you now add the dependency to the pluginspackage.json
andrequire
'd normally.apache/cordova-lib#707
The text was updated successfully, but these errors were encountered: