uidb-dev / react.cordova

best bundle to webApp mobile- react and cordova
67 stars 9 forks source link

cordova.js unavailable on reco start #1

Closed babelouest closed 5 years ago

babelouest commented 5 years ago

After creating a new reco project, while using reco start to work on it, the script cordova.js is unavailable.

Although, the script is mentioned in the file index.html because it's added via cli.js: https://github.com/orchoban/react.cordova/blob/master/bin/cli.js#L731

This makes me unable to use cordova plugins like cordova-plugin-inappbrowser

Unless I didn't understand how to use cordova plugins in development modes?

orchuban commented 5 years ago

Hi, thank you for contacting.

reco start opens only a react.js simulator. so cordova script is not loaded and is loaded after reco build. If you also want to load cordova script while testing dev mode, you can run reco build and after reco cordova serve and choose browser (note: cordova plugins behave differently on each platform). (There is a problem with the browser platform, you probably need to delete the from the URL '/index.html') In this method, the downside is that you will not see real-time changes just after reco build

If you need more help, feel free to contact us always, here or at stack-overflow for question.

orchuban commented 5 years ago

At a later stage, if you have android studio installed and you run a test on an Android device simulator, you can test it with chrome://inspect on Chrome. For IOS platform, on the Mac it's through the Safari DEV option.

babelouest commented 5 years ago

Thanks for the quick answer!

In this method, the downside is that you will not see real-time changes just after reco build

I guess that's what I expected but it's not possible. Thanks for the help!

orchuban commented 5 years ago

@babelouest I arranged it for you. Please update to version @ 1.5.5 (or higher). You can run the following command: reco start or reco serve Then you can choose the option of "bundle serve". I am waiting to receive a review.

babelouest commented 5 years ago

Thanks @orchoban !

I'll take a look at it soon and let you know

orchuban commented 5 years ago

There have been a number of bugs with the beta. From version 1.6.8 everything should work fine. npm i -g react.cordova@latest

babelouest commented 5 years ago

Looks like it works pretty well :) I can live with the delay between each save, thanks a lot @orchoban !