Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Quang Lam
@quanglam2807
maybe that's the reason?
Nathan Buchar
@nathanbuchar
make sure all electron-settings logic is within app.on('ready')
Quang Lam
@quanglam2807
Thanks a lot!!!
Nathan Buchar
@nathanbuchar
I sure hope that's the issue :) I'd hate to be responsible for your app being declined!
Please let me know if you have any further issues/questions :)
Quang Lam
@quanglam2807
Sure!!! Awesome!
lyndsey jane
@lyyyndseyyy_twitter
maybe a silly question, but it looks like electron.settings is not persisting anything to my file system right now -- does it only persist settings when running a packaged app, or should I expect to see a settings file when I'm running in development by manually running electron?
Nathan Buchar
@nathanbuchar
@lyyyndseyyy_twitter Sorry, didn't see this until now! Electron-settings should persist to your filesystem regardless of the environment,
lyndsey jane
@lyyyndseyyy_twitter
yeah, sorry, I should have specified @nathanbuchar -- as far as I can tell, there is no file called "Settings" in the specified directories on either Mac or Linux (I am dual-booting and tried it on both). Electron-settings works fine within a session, but nothing is persisted after I close the app.
Nathan Buchar
@nathanbuchar
are you using electron-settings after app.on('ready')?
Nathan Buchar
@nathanbuchar
try:
const settings = require('electron-settings');

app.on('ready', () => {
  settings.set('foo', 'bar');

  console.log(settings.get('foo')); // "bar"
  console.log(settings.file());  // <the path to the settings file>
});
lyndsey jane
@lyyyndseyyy_twitter
hmm -- so my app is basically just a single html file with what I assume is only one rendering process (basically just electron-quickstart), and I'm including it in what I assume is a rendering process that I thought would only be called after app.on('ready') is called in main.js, but maybe I'm misunderstanding how the rendering process works altogether
I'll try this
maybe there's no reason for it to be where it is at all
Nathan Buchar
@nathanbuchar
it should be fine in the renderer process :) but give the above a shot just to make sure a file is being created and working as expected
lyndsey jane
@lyyyndseyyy_twitter
ok, will do
lyndsey jane
@lyyyndseyyy_twitter
yeah, I saw that
just wasn't sure about the case of only using it in the renderer process
Nathan Buchar
@nathanbuchar
yeah, only renderer process should be okay!
I have tests for that
lyndsey jane
@lyyyndseyyy_twitter
cool cool
lyndsey jane
@lyyyndseyyy_twitter
I think this is just a huuuuuge PEBKAC :thumbsup: but will confirm
Nathan Buchar
@nathanbuchar
:thumbsup:
lyndsey jane
@lyyyndseyyy_twitter
Yup, everything working now
I found the problem and the problem is that I wrote really bad logic
Sorry about that, and thanks!
Nathan Buchar
@nathanbuchar
haha no problem, glad you figured it out! let me know if you have any other questions :)
zorandir
@zorandir

Any ideea of why after I packaged an Electron app an error comes up when trying to start the installer or the packaged version saying "Cannot find module 'electron-settings'"?

@codinmoldovanu_twitter I have the same issue. Can someone help me plz?

Nathan Buchar
@nathanbuchar
could be an issue with package-lock.json
try sudo rm -rf node_modules && npm i
see this issue: nathanbuchar/electron-settings#88
zorandir
@zorandir
I wiil try. Thanks!
infopirate
@infopirate
anyone available right now?
nvmd; const settings = require('electron').remote.require('electron-settings');
fixed it for me!! =D
Nathan Buchar
@nathanbuchar
:)
beetle442002
@beetle442002
What is the proper way to define default setting in the current version?
beetle442002
@beetle442002
Never mind, I believe I figure it out.
cuongtl1992
@cuongtl1992
i get a error content.replace is not a function inside renderer script
when i debug in stripBom function content is buffer but Buffer.isBuffer(content) is always return false
Matt
@mbuk
Hi there, I'm having problems getting my app to run when I build. I'm getting cannot find module 'electron-settings'. I've made sure the package.json has 'electron-settings' in the dependencies. I thought it might be a problem with asar but that doesn't seem to be the issue either. Anyone point me in the right direction? This is what I'm seeing Uncaught Error: Cannot find module 'electron-settings'
Require stack:
I've also deleted packge-lock.json, removed node_modules and run npm install
Matt
@mbuk
Think I've sorted it
Cai Martin
@CaiProgramming
Hey so having an issue on saving settings on mac.
it's not saving anything
Softmedia
@SoftmediaNL_twitter
@mbuk Did you figure it out? I'm running into the "cannot find module 'electron-settings'" error as well. Everything works fine when running a dev window but the actual builds fail
godsamit
@godsamit
Hi, Idk if this group is still active lol... I was trying to use this library to save the positions and sizes of my app's multiple windows. However, it only worked for my startup window. Every other window wasn't saved for some reason.
Could it be related to using localserver? Do I need to explicitly set a path when using this library or just the boilerplate would theoretically work?