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

Android webview #20

Closed
zanzara opened this issue Jan 6, 2023 · 5 comments
Closed

Android webview #20

zanzara opened this issue Jan 6, 2023 · 5 comments

Comments

@zanzara
Copy link

zanzara commented Jan 6, 2023

Seems to be, that this doesn't work for Android's webview (vue->vite->capacitor->android-Studio)

Still have to use API31 (Android12) as minimum for top level awaits and browser-target must be es2022

Can anyone confirm?

@Menci
Copy link
Owner

Menci commented Jan 7, 2023

Could you test your bundle with Chrome with the same version? Or could you connect to the WebView with remote inspector (chrome:https://inspect) to see what happened?

@zanzara
Copy link
Author

zanzara commented Jan 7, 2023

No, unfortunately not.
The same sources are running fine with this toolchain (vue->vite->electron21)
w/o vite-plugin-top-level-await plugin.

The issue is, that browser traget chrome89is sufficient for top level await, but a vanilla webview is still below that version. So I need to got up to API31 (Andriod12) in the SDK/emulator to have at least a webview version arround 90

@zanzara
Copy link
Author

zanzara commented Jan 11, 2023

I did now furhter testing.
If I set such browser targets ie. browser: [ 'edge88', 'firefox78', 'chrome87' ,'es2019' , 'safari13.1'],
then I can't even bundle my project w/o errors mesg.

[vite:esbuild-transpile] Transform failed with 2 errors:
assets/database.14e162eb.js:27746:19: ERROR: Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2019", "firefox78", "safari13.1")

although having this vite-plugin-top-level-await plugin installed?

"devDependencies": {
    "vite-plugin-top-level-await": "^1.2.2"
    }

Any ideas? What I'm doing wrong ?

@Menci
Copy link
Owner

Menci commented Feb 5, 2023

Please post your project for reproduce

@zanzara
Copy link
Author

zanzara commented Feb 5, 2023

You can close this.
I had no success at all - and due to that - I refactored the code eliminating those top level awaits. Sad. :-(

@Menci Menci closed this as completed Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants