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

    __dirname is not defined

    Help
    1
    1
    359
    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.
    • J
      johnboy last edited by johnboy

      New to Quasar and Electron. Creating my first Electron app from a Quasar project.

      If I set nodeIntegration: true in quasar.config.js , all works. However Electron security recommendation is for nodeIntegration: false.

      If I set nodeIntegration: false then when I build and sign the app (for Mac) I get the error:

      ReferenceError: __dirname is not defined
          at Module.10d0 (2.js:1)
      

      and the result is the app does not work correctly.

      The code at that reference position is:

      APP_URL:"file://"+__dirname+"/index.html"}).
      

      Is there a way to work around this?

      (Note: all works correctly running quasar dev -m -electron. The issue is in quasar build -m - electron).

      Thanks.

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