quasar icon indicating copy to clipboard operation
quasar copied to clipboard

$q.platform.is.capacitor return undefined on capacitor android

Open diadal opened this issue 3 years ago • 2 comments

What happened?

$q.platform.is.capacitor return undefined running quasar d -m capacitor -T android --ide

What did you expect to happen?

running test on android studio emulator

Reproduction URL

not link

How to reproduce?

quasar d -m capacitor -T android --ide

Flavour

Quasar CLI (@quasar/cli | @quasar/app)

Areas

Capacitor Mode

Platforms/Browsers

Android

Quasar info output

Dev mode.......... capacitor
 Pkg quasar........ v2.5.5
 Pkg @quasar/app... v3.3.3
 Pkg webpack....... v5
 Debugging......... enabled
 Running mode...... IDE (manual)

 Configured browser support (>= 89.32% of global marketshare):
 · Chrome for Android >= 98
 · Firefox for Android >= 96
 · Android >= 98
 · Chrome >= 89
 · Edge >= 95
 · Firefox >= 88
 · iOS >= 12.0-12.1
 · Opera >= 79
 · Safari >= 13

ctx:  {
  dev: true,
  prod: false,
  mode: { capacitor: true },
  modeName: 'capacitor',
  target: { android: true },
  targetName: 'android',
  emulator: undefined,
  arch: {},
  archName: undefined,
  bundler: {},
  bundlerName: undefined,
  debug: false,
  publish: undefined,
  vueDevtools: false
}

Relevant log output

No response

Additional context

No response

diadal avatar Feb 19 '22 05:02 diadal

Hi @diadal! 👋

It looks like you provided an invalid or unsupported reproduction URL. Do not use any service other than Codepen, jsFiddle, Codesandbox, and GitHub. Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc. Please edit your original post above and provide a valid reproduction URL as explained.

Without a proper reproduction, your issue will have to get closed.

Thank you for your collaboration. 👏

github-actions[bot] avatar Feb 19 '22 05:02 github-actions[bot]

any updates, did found a solution ?

pylvr avatar Jul 23 '22 10:07 pylvr

Cannot reproduce no matter how much I tried. Capacitor v2, v3 or v4. Android or iOS. All seem to work perfectly. Please provide a reproduction repo and I will reopen.

rstoenescu avatar Oct 29 '22 08:10 rstoenescu

@yasserss I have to find a way to fix this then, is possible there is a permanent fixed

const Cplatform = (<{ capacitor: { platform: string } }>(<unknown>$q))?.capacitor?.platform; if (!$q.platform.is.capacitor && !Cplatform)

diadal avatar Oct 29 '22 08:10 diadal

I'm running into the same issue on iOS with Capacitor v3..... it happened suddenly after installing/import a random npm module. window.Capacitor does exist but it looks like the platform detection is ran before it has been set. Is there maybe a way to control this?

lajuffermans avatar May 01 '23 10:05 lajuffermans

Tried a fix. Will be available on next q/app-vite & q/app-webpack

rstoenescu avatar May 02 '23 05:05 rstoenescu

FYI; it seems the issue started when I added WKAppBoundDomains to the Info.plist (as mentioned here: https://github.com/capacitor-community/http#third-party-cookies-on-ios)

So maybe I just broke it? 🤔

lajuffermans avatar May 02 '23 10:05 lajuffermans