adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.27k stars 7.65k forks source link

Failed to load theme resource files on Windows #13745

Open arcticicestudio opened 6 years ago

arcticicestudio commented 6 years ago

Prerequisites

Description

I'm the author of the Nord theme extension. A user reported arcticicestudio/nord-brackets#3 which I was only able to reproduce on Windows 7- and 10. It works fine on my main Arch Linux system (details below).

The theme only differs from other theme extensions by splitting the sources into different files using the @import CSS feature, but this works fine on my main system so this can not be the root cause.

Steps to Reproduce

  1. Install the Nord theme using the extension manager
  2. Activate the theme via View > Themes... and select Nord from the drop-down menu.

Expected behavior:

The theme should be loaded without errors.

Actual behavior:

The theme gets not applied and the debug console throws the following errors (Windows 7- and 10):

Failed to load resource: file:///C:/Program%20Files%20(x86)/Brackets/www/c:/Users/virtu-win10/AppData/Roaming/Brackets/extensions/user/nord-brackets/styles/variables.less (thirdparty.min.js)
file:///C:/Program%20Files%20(x86)/Brackets/www/c:/Users/virtu-win10/AppData/Roaming/Brackets/extensions/user/nord-brackets/styles/editor.less  (thirdparty.min.js)
file:///C:/Program%20Files%20(x86)/Brackets/www/c:/Users/virtu-win10/AppData/Roaming/Brackets/extensions/user/nord-brackets/styles/syntax.less  (thirdparty.min.js)
file:///C:/Program%20Files%20(x86)/Brackets/www/c:/Users/virtu-win10/AppData/Roaming/Brackets/extensions/user/nord-brackets/styles/extensions.less  (thirdparty.min.js)
file:///C:/Program%20Files%20(x86)/Brackets/www/c:/Users/virtu-win10/AppData/Roaming/Brackets/extensions/user/nord-brackets/styles/ui.less  (thirdparty.min.js)

The errors are thrown by file:///C:/Program%20Files%20(x86)/Brackets/www/thirdparty/thirdparty.min.js.

Versions

OS

Tested on Windows 7- and 10 (x86_64) running as Virtual Box. It works fine on my main system running Arch Linux (4.12.13-1-ARCH x86_64) with GNOME 3.24 DE or i3 session.

Brackets

Tested with Brackets 1.10 and the currently latest version 1.11

petetnt commented 6 years ago

Thanks for reporting @arcticicestudio.

The line

Failed to load resource: file:///C:/Program%20Files%20(x86)/Brackets/www/c:/Users/virtu-win10/AppData/Roaming/Brackets/extensions/user/nord-brackets/styles/variables.less

Looks like the culprit, something funky going on with the paths.

petetnt commented 6 years ago

Actual culprit is https://github.com/adobe/brackets/blob/master/src/view/ThemeManager.js#L166-L168 which for some reason doesn't handle Windows URIs

arcticicestudio commented 6 years ago

Good catch on the full URI, I've only looked which file has not been able to be loaded but missed to check if there are errors in the path :smile:

arcticicestudio commented 6 years ago

Any progress with this one or a way to contribute a fix for it? Some users reported after updating to version 1.12 the problem still persists and that there are also a lot of Internal error's when trying to to install any themes now.

petetnt commented 6 years ago

Sorry @arcticicestudio, I did some initial testing getting around it but the issue got lost in the mix.

That said, the fix is either fixing it in the less end or working around the issue in Brackets end.

If you'd like to work on this issue we'd love that! If you need any help navigating the codebase let me know!