anujdatar / onenote-desktop

One Note desktop application
MIT License
94 stars 13 forks source link

Unable to open OneNote #65

Closed seleroy closed 1 year ago

seleroy commented 1 year ago

The onenote-desktop app does not start because it fails to parse a JSON file:

Uncaught Exception:
SyntaxError: Unexpected non-whitespace character after JSON at position 709
    at JSON.parse (<anonymous>)
    at Conf._deserialize (/snap/onenote-desktop/20/resources/app.asar/node_modules/conf/dist/source/index.js:67:43)
    at get store [as store] (/snap/onenote-desktop/20/resources/app.asar/node_modules/conf/dist/source/index.js:278:43)
    at new Conf (/snap/onenote-desktop/20/resources/app.asar/node_modules/conf/dist/source/index.js:131:32)
    at new ElectronStore (/snap/onenote-desktop/20/resources/app.asar/node_modules/electron-store/index.js:69:3)
    at Object.<anonymous> (/snap/onenote-desktop/20/resources/app.asar/lib/appConfig.js:21:16)
    at Module._compile (node:internal/modules/cjs/loader:1269:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1324:10)
    at Module.load (node:internal/modules/cjs/loader:1124:32)
    at Module._load (node:internal/modules/cjs/loader:965:12)

Can you tell me which json file is being read, so that I can check it ?

anujdatar commented 1 year ago

Hi, it seems like your config file may be corrupted?

  1. Close the app.
  2. Go to /home/<user>/snap/onenote-desktop/current/.config/OneNote/.
  3. Delete the config.json file.
  4. Restart the app.

Let me know if this works. And, if it doesn't, I could use some more details like:

  1. Is this a fresh install? Or did it start after a crash or something?
  2. Your OS.
  3. Write permissions in the user's snap folder, etc.
seleroy commented 1 year ago

Thank you, I fixed it my modifying the config.json. It was indeed corrupted and looked like this (extra " and extra } at the end): { "homepage": "https://www.onenote.com/notebooks", "autoHideMenuBar": false, "minimizeToTray": false, "closeToTray": false, "autoShowAboutWindow": false, "enableGPUAcceleration": false, "wasMaximized": true, "width": 800, "height": 600, "currentVersion": "2.2.2", "windowBounds": { "x": 0, "y": 64, "width": 1920, "height": 1136 }, "lastLink": "<my_data>", "lastVersion": "2.2.2" }" }

It started to happen while the application was opened (I started getting the exception in a popup) and not on a crash. Ubuntu 22.04.3 LTS / Gnome 42.9 Anyway it is fixed now, thank you.

anujdatar commented 1 year ago

Cool, let me know if this happens again. Thanks.