Crash switching from custom theme development to installed theme

Bug report

I was developing a new theme in developer mode. I stopped work. I tried to switch back to another theme in Preferences -> Themes but clicking on this crashes the Preferences dialog without being able to display the Themes panel.

Here is the stack trace

TypeError: Cannot read property 'metadata' of undefined
    at d.getCurrentThemeName (file:///Applications/Inkdrop.app/Contents/Resources/app.asar/browser-main.js:4:241161)
    at d.render (file:///Applications/Inkdrop.app/Contents/Resources/app.asar/browser-main.js:4:240745)
    at vi (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:181:192)
    at ui (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:180:282)
    at gk (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:261:396)
    at fk (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:230:22)
    at Zj (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:229:362)
    at Lj (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:223:216)
    at /Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:121:115
    at exports.unstable_runWithPriority (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/scheduler/cjs/scheduler.production.min.js:18:437)
    at fg (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:120:325)
    at ig (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:121:61)
    at jg (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:120:496)
    at fb (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:285:91)
    at Nd (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:82:277)
    at HTMLDocument.__trace__ (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/@bugsnag/browser/plugin-inline-script-content/inline-script-content.js:138:30)

Info

  • Platform: (macOS)
  • Platform version: (Mojave/10.14.6)
  • App Version: (4.6.1)

Reproduce

Follow the instructions to start custom theme development. Make changes to your theme, reload Inkdrop, and observe that your changes are taking effect. Then try to switch back to an existing loaded theme at Preferences -> Themes.

Also, if it was not clear from the bug report, I can’t switch themes until this is resolved. Right now Inkdrop Editor view is displaying black text on white background with no syntax highlighting.

Hi Mark,

Thank you for reporting it.
Great to hear that you are making a theme!

The error could happen when the current theme could not be found.
So, I guess you changed your theme name?

You have to reset the theme settings in config.cson in the user data directory.
For example, you should have a config file like so:

"*":
  core:
    devMode: true
    themes: [
      "default-dark-ui"
      "github-preview"
      "default-dark-syntax"
    ]

And you can remove *.core.themes and relaunch the app. Or, you can change it manually.

1 Like

That worked to fix it. Thanks! You can close this ticket.

1 Like

Great!