Go Pro Sign Up Login
0 days 0 hrs 0 min 0 sec

Summer Sale

50% off Level Up Pro until you unsubscribe.
Get access to ALL 128 courses on Level Up Tutorials

This is your last chance to get Level Up Pro for $145/year.

or Learn More
Moon Moon

Buy Now and unlock this series







yours forever

Become a Pro and unlock everything




per month

Reading A File

I’ll be showing how you can add a file to the Main process using our new Menu skills to trigger a function to open and read a file. You’ll learn some of the core functions that will enable you to read entire directories-worth of files and edit, modify, save, and create new files.


Become a pro to download code and videos



over 1 year ago

@Chris Borchert's solution worked for me as well. Would be great to have an updated video series @LevelUp


almost 2 years ago

@Chris Borchert That's exactly what I experienced as well; using dialog.showOpenDialog() actually throws errors with the file path that's returned not being a string. Adding a global mainWindow ( let mainWindow ), since reviewing Scott's course repo shows that I missed that step in a video, plus using dialog.showOpenDialogSync() resolved any issues I had using the current version of electron.js.

Chris Borchert

about 2 years ago

Any one else having any issues using a newer version of Electron should either make sure to have the correct version of electron or use dialog.showOpenDialogSync() instead of dialog.showOpenDialog(), since dialog.showOpenDialogSync returns a Promise now.

Want to join the conversation?

Become a Pro member today!