Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Capacitor 3 adds the 'cordova' and 'hybrid' platforms to web #4198

Closed
lincolnthree opened this issue Feb 12, 2021 · 2 comments
Closed

Comments

@lincolnthree
Copy link

lincolnthree commented Feb 12, 2021

Bug Report

Capacitor Version

sharktop:example lincoln$ npx cap doctor
💊   Capacitor Doctor  💊 

Latest Dependencies:

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

Installed Dependencies:

  @capacitor/cli: 3.0.0-beta.2
  @capacitor/core: 3.0.0-beta.2
  @capacitor/android: 3.0.0-beta.2
  @capacitor/ios: 3.0.0-beta.2


Platform(s)

Web, PWA

Current Behavior

Fairly simple issue. After upgrading to Capacitor 3.x, we noticed that Native plugin wrappers were attempting (and failing) to activate in our Web & PWA platform builds, across the board.

After a night of investigation, we've determined that Capacitor is incorrectly adding the 'cordova' and 'hybrid' platforms when running in the 'web' platform.

See screenshot of printed platforms running with ionic serve --port 8101 (port 8100 was taken):

image

Expected Behavior

As with Capacitor 2.4.6, we'd expect the additional platforms to be added only when running in the actual environments to which they represent. Like so:

image

Code Reproduction

##Demonstrates the breaking behavior:

git clone [email protected]:lincolnthree/capacitor-3-platforms-incorrect.git
npm i
ionic serve
# Open browser dev tools and view printed platforms in console

https://github.com/lincolnthree/capacitor-3-platforms-incorrect

##Demonstrates the expected behavior:

git clone [email protected]:lincolnthree/capacitor-3-platforms-incorrect.git
git checkout 2.4.6
npm i
ionic serve
# Open browser dev tools and view printed platforms in console

https://github.com/lincolnthree/capacitor-3-platforms-incorrect/tree/2.4.6

Other Technical Details

npm --version output: 6.14.9

node --version output: v14.15.0

pod --version output (iOS issues only):

Additional Context

We have not been able to find a suitable workaround, but if one exists, we'd love to hear it! If this behavior is intended, how can we disable it for backwards compatibility with our already implemented platform detection checks?

@imhoffd
Copy link
Contributor

imhoffd commented Feb 17, 2021

Fixed in #4214

@imhoffd imhoffd closed this as completed Feb 17, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants