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

    ipcRenderer and Platform Detection in Boot Files

    Help
    1
    2
    431
    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.
    • S
      stuartcusack last edited by stuartcusack

      Can someone tell me the correct way to achieve this:

      I have a Boot file called oauth/index.js:

      import { Platform } from 'quasar'
      const { ipcRenderer } = require('electron');
      
      class OAuth {
          
         // Send a message to electron
         storeAuthData () {
             if (Platform.is.electron) {
               ipcRenderer.send('setSecurePassword', password);
             }
         }
      
      }
      

      This works fine when I build Electron but when I build SPA or run ‘quasar dev’ I get the following error:
      Uncaught TypeError: fs.existsSync is not a function

      I opened a GitHub bug but I was told that I am not using Platform Detection correctly.

      Any ideas? Thanks.

      1 Reply Last reply Reply Quote 0
      • S
        stuartcusack last edited by stuartcusack

        Seems the only solution for the moment is to have two separate Boot files and perform platform detection within quasar.conf. I might need to rethink my oauth system.

        https://github.com/quasarframework/quasar/issues/4552

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