Open gxolin opened 1 month ago
Would you mind sharing your small test app (in a git repository, or archive)? This way I don't have to recreate one in order to attempt to reproduce this (I don't have a capacitor + angular project ready to test this). Thanks!
sure, I have some proprietary code at the moment, I'll try to make a cleaned up version as soon as possible, thanks
@j3k0
> git clone git@github.com:gxolin/test.git
> cd test/
> npm i
launching ng build
should crash with :
> ng build
An unhandled exception occurred: Cannot destructure property 'routes' of '(intermediate value)' as it is undefined.
See "/tmp/ng-L2Kqxa/angular-errors.log" for further details.
Custom code not generated by angular/capacitor installation :
{ provide: IapService, useClass: IapBrowserService }
{ provide: IapService, useClass: IapNodeService }
import 'cordova-plugin-purchase';
here : test/src/app/services/iap.service.tslet me know if you need something else or if I can help !
It's not ideal, but as a workaround in the meantime, i've pushed a PR to the awesome-cordova-plugins repository (see mention just above). I don't know how all of this works, but apparently the way awesome-cordova import the scripts don't throw the error mentioned before.
(Note for visitors : my workaround, is only lightly tested, I'm new to both capacitor and cordova-plugin-purchase. I'll test it more thoughtfully in the next days, I'm working on a angular + capacitor in app purchase integration.)
I'm running a small angular application, with capacitor enabled for ios/android, and everything worked fine until I import this plugin.
Context : I'm totally new to the capacitor/cordova development but I have a significant angular app running. I'm making a small test app with
cordovaedit: Capacitor to investigate the possibility to add capacitor & in-app purchases to build my app for native markets. I can't remove or disable some angular features like SSR, because they are critical for my application.Observed behavior
When I'm in a .ts file, when I add any of those two imports :
I can't build my application anymore :
(Removing this import allows the build to complete without errors)
Note : When using ng serve, the code compiles as expected.
Expected behavior
no errors during build
System Info
my (simplified) package.json :
Output of
cordova info
.