question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: in a monorepo capacitor cannot find any plugins if installed in the root package.json

See original GitHub issue

Bug Report

It is currently not possible to use Capacitor in a monorepo properly without adding any plugin to each apps package.json. This is super inefficient and can lead to different versions between apps that share the same core (ofc the compiler would catch some bugs but maybe not all).

I have some ideas to fix this:

  1. Since capacitor is a standalone framework I would not like it do depend on other frameworks “workspace” features like Angular or Ionic but what about a new section in the capacitor.config.json that explicitly requires plugins to be included. This would add another benefit by not including plugins that one just installed to test something and forgot do uninstall later.
  2. Search through all code for “@capacitor/*” 🤪
  3. also search by “peerDependencies” so something like this will work "peerDependencies": { "@capacitor/app": "*" }

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 3.2.2
  @capacitor/core: 3.2.2
  @capacitor/android: 3.2.2
  @capacitor/ios: 3.2.2

Installed Dependencies:

  @capacitor/cli: 3.2.2
  @capacitor/core: 3.2.2
  @capacitor/android: 3.2.2
  @capacitor/ios: 3.2.2

Platform(s)

All

Current Behavior

No plugins added to Podfile e.g.

Expected Behavior

Include them in some way

Code Reproduction

Create an ionic multi app following this guide: https://openforge.io/mobile-academy/guides/mobile-app-development/how-to-create-a-monorepo-with-ionic-angular-appflow/

Other Technical Details

npm --version output: 6.x

node --version output: 14.x

pod --version output (iOS issues only):

Additional Context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
distantecommented, Feb 22, 2022

I am trying to sell the idea of using Ionic where I work at, but we use nx monorepos. It makes it hard to sell 😕

0reactions
ionitron-bot[bot]commented, Nov 10, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capacitor 3.0 Upgrade Plugins "not implemented" Exception ...
I have installed every plugin for the whole app (the root) and for the nx-capacitor app (the capacitor app added with @nxtend-capacitor) as ......
Read more >
[Capacitor 3] Custom plugin doesn't have dist folder after ...
Hi,. I migrated my app and a custom plugin to Capacitor 3 and facing one last problem. When installing the custom plugin from...
Read more >
How to run ionic capacitor app from nx monorerepo in live ...
First of, it's not necessary to use @nxtend/capacitor at all. Within nx monorepo it's possible to configure app's project.json (apps/awesome-app/project.json) ...
Read more >
11 Great Tools for a Monorepo in 2021 | Bits and Pieces
In this roundup, I've gathered some of the best tools in the world to ... import a library that was missing from your...
Read more >
patch-package - npm
json. If it's a transitive dependency patch-package can't detect that it is safe to ignore and will throw an error. To fix this,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found