Skip to content
Discussion options

You must be logged in to vote

Not really sure about why you’d use __dirname in the renderer process - it won’t work by default since nodeIntegration and contextIsolation prevent Node modules from being exposed there (for security reasons).

If you need the project’s root directory path in both dev and production (bundled) environments under the renderer process (app), you’ll have to expose it through a Conveyor API + handler or IPC call.

import { app } from 'electron';

// it can be used in some Conveyor API handler which lets you write the file in the project root
const appRootPath = app.getAppPath();

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ENNA-Egor
Comment options

Answer selected by ENNA-Egor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants