quasar
quasar copied to clipboard
$q.platform.is.capacitor return undefined on capacitor android
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
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. 👏
any updates, did found a solution ?
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.
@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)
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?
Tried a fix. Will be available on next q/app-vite & q/app-webpack
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? 🤔