Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Syntax Error in Theme crashes Atom #7282

Closed

Description

@elana-voss

Atom 0.209.0

I have been writing a custom syntax theme. Leaving out a semicolon by accident caused Atom to crash during restart (cmd-alt-option-L), instead of switching to a default theme.

COLOR.LESS
@string:#00894D// #30884D;  <-- colon missing
CONSOLE
Error
    at new Parser (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/less-cache/node_modules/less/lib/less/parser.js:333:27)
    at LessCache.module.exports.LessCache.parseLess (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/less-cache/lib/less-cache.js:244:16)
    at LessCache.module.exports.LessCache.cssForFile (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/less-cache/lib/less-cache.js:275:20)
    at LessCache.module.exports.LessCache.readFileSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/less-cache/lib/less-cache.js:263:19)
    at LessCompileCache.module.exports.LessCompileCache.read (/Applications/Atom.app/Contents/Resources/app.asar/src/less-compile-cache.js:36:25)
    at ThemeManager.module.exports.ThemeManager.loadLessStylesheet (/Applications/Atom.app/Contents/Resources/app.asar/src/theme-manager.js:310:33)
    at ThemeManager.module.exports.ThemeManager.loadStylesheet (/Applications/Atom.app/Contents/Resources/app.asar/src/theme-manager.js:286:21)
    at ThemeManager.module.exports.ThemeManager.requireStylesheet (/Applications/Atom.app/Contents/Resources/app.asar/src/theme-manager.js:203:24)
    at ThemeManager.module.exports.ThemeManager.reloadBaseStylesheets (/Applications/Atom.app/Contents/Resources/app.asar/src/theme-manager.js:266:12)
    at ThemeManager.module.exports.ThemeManager.loadBaseStylesheets (/Applications/Atom.app/Contents/Resources/app.asar/src/theme-manager.js:261:19)index.js:66 handleSetupError

Activity

  1. benogle commented on Jun 15, 2015

    @benogle
    Contributor

    Can you elaborate on the what happens when atom 'crashes'? Does it crash crash or does it just not load the theme?

  2. elana-voss commented on Jun 15, 2015

    @elana-voss
    Author

    The main screen of Atom stays white and the error message given above appears in the developer console, which I left open before restarting with cmd-alt-option-L.
    Even the settings page is not accessible via shortcut anymore.
    File > Open brings up a new window, but it behaves just as the first window: white screen.

    I am not very familiar with Atom, if there is an error log that would be helpful, please let me know.

  3. dkniffin commented on Jul 21, 2015

    @dkniffin

    👍 I can confirm this. I got the same issue when I added a theme that had the following line at the end:

    @syntax-color-removed: #eb008a;%
    

    (notice the extraneous percent sign at the end)

  4. andrewwylde commented on Aug 5, 2015

    @andrewwylde

    I'm experiencing the same issue as @xerik. Is there a workaround for this? I tried doing a clean install & using zip and am still experiencing this.

    Error log:

    Error
        at new Parser (D:\Downloads\Installers\atom-windows\Atom\resources\app.asar\node_modules\less-cache\node_modules\less\lib\less\parser.js:333:27)
        at LessCache.module.exports.LessCache.parseLess (D:\Downloads\Installers\atom-windows\Atom\resources\app.asar\node_modules\less-cache\lib\less-cache.js:244:16)
        at LessCache.module.exports.LessCache.cssForFile (D:\Downloads\Installers\atom-windows\Atom\resources\app.asar\node_modules\less-cache\lib\less-cache.js:275:20)
        at LessCache.module.exports.LessCache.readFileSync (D:\Downloads\Installers\atom-windows\Atom\resources\app.asar\node_modules\less-cache\lib\less-cache.js:263:19)
        at LessCompileCache.module.exports.LessCompileCache.read (D:\Downloads\Installers\atom-windows\Atom\resources\app.asar\src\less-compile-cache.js:36:25)
        at ThemeManager.module.exports.ThemeManager.loadLessStylesheet (D:\Downloads\Installers\atom-windows\Atom\resources\app.asar\src\theme-manager.js:310:33)
        at ThemeManager.module.exports.ThemeManager.loadStylesheet (D:\Downloads\Installers\atom-windows\Atom\resources\app.asar\src\theme-manager.js:286:21)
        at ThemeManager.module.exports.ThemeManager.requireStylesheet (D:\Downloads\Installers\atom-windows\Atom\resources\app.asar\src\theme-manager.js:203:24)
        at ThemeManager.module.exports.ThemeManager.reloadBaseStylesheets (D:\Downloads\Installers\atom-windows\Atom\resources\app.asar\src\theme-manager.js:266:12)
        at ThemeManager.module.exports.ThemeManager.loadBaseStylesheets (D:\Downloads\Installers\atom-windows\Atom\resources\app.asar\src\theme-manager.js:261:19)index.js:66 handleSetupError
    

    This is the view when I try to open:
    image

  5. chuntr commented on Jan 20, 2016

    @chuntr

    I can also confirm. Had a missing semi-colon in .atom/packages/monokai-seti/styles/syntax.less (which I had been editing). This completely prevented atom from loading properly until I fixed the file.

  6. shersi commented on Jul 5, 2016

    @shersi

    Has there been any development on this issue?

    This is the window i get, when i launch atom.

    skjermbilde 2016-07-05 14 50 33

  7. lee-dohm commented on Jul 6, 2016

    @lee-dohm
    Contributor

    The workaround for this is to do the following:

    1. Exit Atom
    2. Rename the ~/.atom directory to ~/.atom-backup
    3. Launch Atom again

    This will reset your Atom to default settings.

  8. shersi commented on Jul 8, 2016

    @shersi

    It worked 😃

  9. it-giants commented on Jul 20, 2016

    @it-giants

    Hi please I hope your Answer be more clear what about if I am windows user ? what I have to change can you upload some screenshots I really feel bad ATOM support so bad and less videos of solving problems I am really boring trying to fix the same problem 1 month ago until now I can't use ATOM for little bullshit problem sorry I am angry a little bit ... :(

  10. winstliu commented on Jul 20, 2016

    @winstliu
    Contributor
    1. Exit Atom
    2. Rename the %USERPROFILE%\.atom directory to %USERPROFILE%\.atom-backup.
    3. Launch Atom again
  11. swrobel commented on Jul 20, 2016

    @swrobel

    I don't see why it's an acceptable to have the solution be to trash your entire atom profile over a bad theme.

  12. winstliu commented on Jul 20, 2016

    @winstliu
    Contributor

    The above commands do not "trash" your existing Atom profile. It is fairly equivalent (but not identical) to executing atom --safe from the terminal. You can then start moving stuff from .atom-backup back into .atom to figure out which package (or perhaps your styles.less file) is causing the issue.

    The correct solution is of course for Atom to include which syntax theme has a syntax error in the exception message, and then to avoid loading it if possible. However, that hasn't been implemented yet, which is why this issue is still open.

  13. VivekWisdom commented on Aug 28, 2016

    @VivekWisdom

    This error is coming because of some packages are having bugs. I managed to open atom by removing my last two updated packages. After update only I got problems.

    Next reinstalling the same package worked fine.

    Hope it helps.

  14. MichaelJCole commented on Oct 20, 2016

    @MichaelJCole

    Ooof. More or less the exact same error but on Linux. Bummer a bad package update can break everyone's atom install. So much for playing with themes.

    You may find your theme config in ~/.atom/config.cson

    Editing this file to remove the *.core.themes array was a workaround for me.

    Is there a reason Atom wouldn't do this automatically on error?

    index.js:62 Error
        at new Parser (/opt/atom/resources/app.asar/node_modules/less/lib/less/parser.js:333)
        at LessCache.module.exports.LessCache.parseLess (/opt/atom/resources/app.asar/node_modules/less-cache/lib/less-cache.js:255)
        at LessCache.module.exports.LessCache.cssForFile (/opt/atom/resources/app.asar/node_modules/less-cache/lib/less-cache.js:286)
        at LessCache.module.exports.LessCache.readFileSync (/opt/atom/resources/app.asar/node_modules/less-cache/lib/less-cache.js:274)
        at LessCompileCache.module.exports.LessCompileCache.read (/opt/atom/resources/app.asar/src/less-compile-cache.js:36)
        at ThemeManager.module.exports.ThemeManager.loadLessStylesheet (/opt/atom/resources/app.asar/src/theme-manager.js:280)
        at ThemeManager.module.exports.ThemeManager.loadStylesheet (/opt/atom/resources/app.asar/src/theme-manager.js:256)
        at ThemeManager.module.exports.ThemeManager.requireStylesheet (/opt/atom/resources/app.asar/src/theme-manager.js:174)
        at ThemeManager.module.exports.ThemeManager.reloadBaseStylesheets (/opt/atom/resources/app.asar/src/theme-manager.js:236)
        at ThemeManager.module.exports.ThemeManager.loadBaseStylesheets (/opt/atom/resources/app.asar/src/theme-manager.js:231)
        at new AtomEnvironment (/opt/atom/resources/app.asar/src/atom-environment.js:270)
        at module.exports (/opt/atom/resources/app.asar/src/initialize-application-window.js:22)
        at setupWindow (index.js:82)
        at window.onload (index.js:41)handleSetupError @ index.js:62
    
  15. stale commented on Oct 20, 2017

    @stale

    Thanks for your contribution!

    This issue has been automatically marked as stale because it has not had recent activity. Because the Atom team treats their issues as their backlog, stale issues are closed. If you would like this issue to remain open:

    1. Verify that you can still reproduce the issue in the latest version of Atom
    2. Comment that the issue is still reproducible and include:
      • What version of Atom you reproduced the issue on
      • What OS and version you reproduced the issue on
      • What steps you followed to reproduce the issue

    Issues that are labeled as triaged will not be automatically marked as stale.

  16. lock commented on May 2, 2018

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  17. locked as resolved and limited conversation to collaborators on May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions