CapacitorGoogleAuth icon indicating copy to clipboard operation
CapacitorGoogleAuth copied to clipboard

Change import from capacitor.config.json to capacitor.config.ts in capacitor 3+

Open MarnusCoetzee opened this issue 4 years ago • 5 comments

web.js currently default imports the config from the capacitor.config.json, however in the latest capacitor apps a .ts file is used. Would recommend making a note about it for Angular 12+ usage to just create a capacitor.config.json file with the capacitor config

MarnusCoetzee avatar Jun 19 '21 10:06 MarnusCoetzee

Yes this is what it's failing for me with as well:

[ng] ./node_modules/@codetrix-studio/capacitor-google-auth/dist/esm/web.js:3:0-58 - Error: Module not found: Error: Can't resolve '../../../../../capacitor.config.json' in '/Users/matthewharris/rtp/rtpSoftware/Ionic/_Tutorials/trillo/node_modules/@codetrix-studio/capacitor-google-auth/dist/esm'

So the temporary workaround solution is to revert back to the json version of the capacitor.config rather than the new ts format.

Hopefully a patch will be released soon that will take this possibility into account.

Tip: In vscode, I stripped back the ts file so it was just the two braces, then when I applied source formatting to the page it automatically put all the speech marks around the keys and values without me having to type it all.

rtpHarry avatar Aug 19 '21 16:08 rtpHarry

Seems a fix is being worked on with #114 but not finished yet

rtpHarry avatar Aug 19 '21 16:08 rtpHarry

Hello, any news about this problem ?

adelabd avatar Nov 20 '21 14:11 adelabd

Currently the latest version (3.1.0 today) resolve the problem but it is not availabile on npm. So if you want the latest version , you have to put the following into your package.json : "@codetrix-studio/capacitor-google-auth": "git://github.com:CodetrixStudio/CapacitorGoogleAuth.git". With this, it works with capacitor.config.ts (by waiting the release with the tag on npm ...)

adelabd avatar Nov 20 '21 20:11 adelabd

@adelabd when it will be available on npm (v3.1.0) , because its not work on production .

penkong avatar Feb 01 '22 08:02 penkong