Bug Report
Plugin(s)
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 7.2.0
@capacitor/core: 7.2.0
@capacitor/android: 7.2.0
@capacitor/ios: 7.2.0
Installed Dependencies:
@capacitor/cli: 7.2.0
@capacitor/android: 7.2.0
@capacitor/ios: 7.2.0
@capacitor/core: 7.2.0
[success] iOS looking great! 👌
[success] Android looking great! 👌
Platform(s)
- Ubuntu 24.04.2 LTS (via GitHub Actions)
- macOS Sonoma 14.6.1 (23G93) (locally)
Current Behavior
- Integration tests using Playwright that encounter
await Device.getLanguageCode() hang and time out; there's no log output in the browser spawned by Playwright, nor in the Playwright logs
- Using the same browser version by hand to access the web server created by
vite --host works, and the plugin returns the language code of navigator.language
Expected Behavior
- Integration tests using Playwright that encounter
await Device.getLanguageCode() receive the language code of navigator.language
- Using the same browser version by hand to access the web server created by
vite --host works, and the plugin returns the language code of navigator.language
Code Reproduction
- Clone this branch of the affected project
- Run
nvm install && nvm use && npm install
- Run
npm run test:e2e
- Notice browsers opening an empty page, which stays for 60 seconds, after which the test times out and fails
- Comment out the call to
await Device.getLanguageCode() by commenting out lines 27 and 28 of /src/main.ts
- Notice browsers loading the app and tests succeeding after ~30 seconds
Other Technical Details
Reproducible using GitHub Actions: https://github.com/ViMaSter/gdqreminder-mobile/actions/runs/15228335975/job/42833119806#step:6:47
Replacing the call to Device.getLanguageCode() with a function with the same content works:
const getLocale = async () => {
return {value: navigator.language.split('-')[0].toLowerCase()};
};
console.log(await getLocale()); // returns `en`
console.log((await Device.getLanguageCode()).value); // hangs
However, this skips the native methods implemented by the plugin on iOS and Android, making this a suboptimal workaround.
Additional Context
n/a
Bug Report
Plugin(s)
@capacitor/device: 7.0.1Capacitor Version
Platform(s)
Current Behavior
await Device.getLanguageCode()hang and time out; there's no log output in the browser spawned by Playwright, nor in the Playwright logsvite --hostworks, and the plugin returns the language code ofnavigator.languageExpected Behavior
await Device.getLanguageCode()receive the language code ofnavigator.languagevite --hostworks, and the plugin returns the language code ofnavigator.languageCode Reproduction
nvm install && nvm use && npm installnpm run test:e2eawait Device.getLanguageCode()by commenting out lines 27 and 28 of/src/main.tsOther Technical Details
Reproducible using GitHub Actions: https://github.com/ViMaSter/gdqreminder-mobile/actions/runs/15228335975/job/42833119806#step:6:47
Replacing the call to
Device.getLanguageCode()with a function with the same content works:However, this skips the native methods implemented by the plugin on iOS and Android, making this a suboptimal workaround.
Additional Context
n/a