CapacitorGoogleAuth icon indicating copy to clipboard operation
CapacitorGoogleAuth copied to clipboard

Relative module reference does not work with monorepo directory structure

Open fjaeger opened this issue 4 years ago • 2 comments

In our monorepo project, all nom dependencies are hoisted to the root directory's node_modules directory. In /node_modules/@codetrix-studio/capacitor-google-auth/dist/esm/web.js you reference ../../../../../capacitor.config.json, which obviously does not work as the capacitor.config.json file is in a subdirectory of the root.

Any ideas on how to solve this issue?

fjaeger avatar Jun 21 '21 08:06 fjaeger

I'm getting the same error in a standard ionic project.

fmendoza avatar Jun 28 '21 21:06 fmendoza

Short Hack, I Have used

Goto node_modules/@codetrix-studio/capacitor-google-auth/dist/esm/web.js

Replace capacitor.config.json to ionic.config.json

import { WebPlugin } from '@capacitor/core'; // @ts-ignore //import config from '../../../../../capacitor.config.json'; import config from '../../../../../ionic.config.json';

In your ionic.config.json

{ "name": "xxxxx", "integrations": { "capacitor": {} }, "type": "angular", "plugins": { "SplashScreen": { "launchShowDuration": 0 }, "GoogleAuth": { "scopes": [ "profile", "email" ], "serverClientId": "xxxxxxxx.googleusercontent.com", "forceCodeForRefreshToken": true } } }

th3n00bc0d3r avatar Aug 06 '21 10:08 th3n00bc0d3r