No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Capacitor core plugins break when setting devServer to 'https'

    Help
    2
    3
    429
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dannyalder88 last edited by

      I’m working on an Android app using Quasar and Capacitor. Everything has been going well until I needed to change the dev server to use https so I can access navigator.mediaDevices (only available over https). However, setting this option in the quasar.conf.js seems to break the core capacitor plugins. For example, the Permissions API plugin errors with ‘the Permissions API is not supported by the web browser’.

      I’ve had a google around and found this issue and this issue (I am also getting the ‘window.Capacitor.triggerEvent is not a function’ on first load. Although the page is rendering). Both state issues with running the quasar app through https on Capacitor, however, they also state that this should be fixed in quasar/app v2 which I am using.

      Turning off https on the Quasar devServer resolves the issue so I’m assuming it is related to that setting but could be wrong.

      Is there be another I need to add to the Capacitor side of things to allow Quasar to run the devServer properly under https without breaking the Capacitor plugin’s functionality? Any help from anyone who may have more knowledge or has run into this before would be greatly appreciated 🙂

      Using
      Quasar 1.12.8
      Quasar/app 2.0.1
      Capacitor/core 2.0.0
      Capacitor/android 2.2.0

      1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel last edited by dobbel

        What comes to my mind is: you can set https in the devServer but the certificates won’t be valid.( chrome firefox will give you a warning if you try to load the app on your dev machine). Also the phone’s webview/capacitor will see it’s not a valid ssl connection and could cripple things. This could be fixed by some thing like https://ngrok.com

        1 Reply Last reply Reply Quote 0
        • D
          dannyalder88 last edited by

          I think you’re right that its to do with the certificates. I did some more research and if I’m reading correctly, setting devServer to https means that Quasar now modifies the webViewClient in Capacitor to allow self-signed certificates (as it originally broke the app). I get the security warning in Chrome as you suggest but not when running on the android device. Could Quasar be modifying the webView for https in a way that means it thinks it doesn’t support the Permissions API?

          Looks like building the app is fine and all plugins work with the correct https settings for the mediaDevice access. So I can just work around the issue for now 🙂

          1 Reply Last reply Reply Quote 0
          • First post
            Last post