abe33 / atom-pigments

An Atom package to display colors in project and files.
MIT License
524 stars 71 forks source link

Pigments not showing up after reinstall #241

Open guidolarosa opened 7 years ago

guidolarosa commented 7 years ago

Hi! This problem showed up after reinstalling Pigments on Atom via the Install Packages windows. I reinstalled it because it wasn't working for a couple of days, and after I installed it for the second time, this error shows up...

Atom Version: 1.11.2 Electron Version: 0.37.8 System: Mac OS X 10.10 Thrown From: pigments package, v0.37.0

Stack Trace

Uncaught TypeError: ColorContext is not a constructor

At /Users/GuidoLaRosa/.atom/packages/pigments/lib/variables-collection.coffee:240

TypeError: ColorContext is not a constructor
    at VariablesCollection.module.exports.VariablesCollection.getContext (/Users/GuidoLaRosa/.atom/packages/pigments/lib/variables-collection.coffee:240:9)
    at ColorProject.module.exports.ColorProject.getContext (/Users/GuidoLaRosa/.atom/packages/pigments/lib/color-project.coffee:425:29)
    at ColorProject.module.exports.ColorProject.findAllColors (/Users/GuidoLaRosa/.atom/packages/pigments/lib/color-project.coffee:246:17)
    at /Users/GuidoLaRosa/.atom/packages/pigments/lib/pigments.coffee:93:37
    at Workspace.module.exports.Workspace.openURIInPane (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:502:22)
    at Object.module.exports.findColors (/Users/GuidoLaRosa/.atom/packages/pigments/lib/pigments.coffee:238:20)
    at atom-workspace.atom.commands.add.pigments:find-colors (/Users/GuidoLaRosa/.atom/packages/pigments/lib/pigments.coffee:24:35)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:183:32)
    at CommandPaletteView.module.exports.SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
    at space-pen-li.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:139:19)
    at HTMLOListElement.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
    at HTMLOListElement.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)

Commands

     -7:02.9.0 pigments:show-palette (atom-text-editor.editor)
     -6:20.7.0 settings-view:open (atom-text-editor.editor.is-focused)
  2x -6:13.6.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -4:29.9.0 command-palette:toggle (div.package-readme.native-key-bindings)
     -4:28.6.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -4:25.3.0 fuzzy-finder:toggle-file-finder (div.package-detail.panels-item)
  3x -2:53.7.0 core:backspace (atom-text-editor#pigments.extendedSearchNames.editor.mini.is-focused)
     -2:51.7.0 core:confirm (atom-text-editor#pigments.extendedSearchNames.editor.mini.is-focused)
     -0:21.3.0 pane:show-previous-item (atom-text-editor.editor.is-focused)
     -0:18.7.0 symbols-view:toggle-project-symbols (atom-text-editor.editor.is-focused)
     -0:14.7.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:12 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.is-focused)
     -0:07.8.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -0:07.8.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:06.3.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:02.3.0 pigments:find-colors (atom-text-editor.editor)

Config

{
  "core": {
    "disabledPackages": [
      "jade"
    ],
    "ignoredNames": [
      "*.none"
    ],
    "telemetryConsent": "limited",
    "themes": [
      "one-dark-ui",
      "gaia-dark-syntax"
    ]
  },
  "pigments": {
    "delayBeforeScan": 200,
    "extendAutocompleteToColorValue": true,
    "extendedSearchNames": [
      "**/*.styl"
    ],
    "groupPaletteColors": "by file",
    "markerType": "background",
    "sortPaletteColors": "by color"
  }
}

Installed Packages

# User
ask-stack, v2.2.0 (inactive)
atom-beautify, v0.29.13 (active)
atom-bootstrap3, v1.2.12 (inactive)
atom-jade, v0.3.0 (active)
autoclose-html, v0.23.0 (active)
color-picker, v2.2.2 (active)
file-icons, v1.7.22 (active)
gaia-dark-syntax, v1.1.0 (active)
jade, v0.1.2 (inactive)
jade-beautify, v0.1.5 (active)
language-pug, v0.0.19 (active)
minimap, v4.25.0 (active)
monokai-complete-syntax, v0.2.3 (inactive)
pigments, v0.37.0 (active)
preview-plus, v1.2.7 (active)
processing-language, v0.2.0 (active)
seti-ui, v1.3.2 (inactive)
Stylus, v3.1.0 (active)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.44.0 (inactive)
base16-tomorrow-dark-theme, v1.2.0 (inactive)
base16-tomorrow-light-theme, v1.2.0 (inactive)
one-dark-ui, v1.6.0 (active)
one-light-ui, v1.6.0 (inactive)
one-dark-syntax, v1.3.0 (inactive)
one-light-syntax, v1.3.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.7.0 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.2 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.1 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.42.0 (active)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (active)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.40.0 (active)
find-and-replace, v0.201.1 (inactive)
fuzzy-finder, v1.4.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.2 (active)
image-view, v0.59.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v1.0.0 (active)
notifications, v0.65.1 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.242.2-hotfix1 (active)
snippets, v1.0.2 (active)
spell-check, v0.68.2 (active)
status-bar, v1.4.1 (active)
styleguide, v0.47.0 (active)
symbols-view, v0.113.1 (active)
tabs, v0.101.0 (active)
timecop, v0.33.2 (active)
tree-view, v0.209.3 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.35.1 (active)
whitespace, v0.33.0 (active)
wrap-guide, v0.38.2 (active)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.2 (active)
language-csharp, v0.12.1 (active)
language-css, v0.37.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.42.1 (active)
language-html, v0.45.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.23.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.2 (active)
language-less, v0.29.5 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (active)
language-php, v0.37.2 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (active)
language-ruby, v0.69.0 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.56.0 (active)
language-shellscript, v0.22.4 (active)
language-source, v0.9.0 (active)
language-sql, v0.23.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.9 (active)
language-yaml, v0.26.0 (active)

# Dev
No dev packages

`

Is this a bug or a mistake in my configuration?

Thanks.

abe33 commented 7 years ago

Hi @guidolarosa,

It's definitely a bug, but I hardly see how it could get to this point, it looks like either on file is missing (the color context one) or the module cache gets somehow corrupted.

Have you tried completely removing the package directory then reinstall it?

guidolarosa commented 7 years ago

Hi! I removed the package directory, I reinstalled it and now it shows me this error when I reload pigments via the Command Palette. I think it has something to do with the fact that Atom updated a couple days ago, but I'm not sure.

The following message is displayed by Atom:

TypeError: ColorContext is not a constructor
    at VariablesCollection.module.exports.VariablesCollection.getContext (~/.atom/packages/pigments/lib/variables-collection.coffee:240:9)
    at VariablesCollection.module.exports.VariablesCollection.evaluateVariableColor (~/.atom/packages/pigments/lib/variables-collection.coffee:324:16)
    at VariablesCollection.module.exports.VariablesCollection.createVariable (~/.atom/packages/pigments/lib/variables-collection.coffee:315:6)
    at VariablesCollection.module.exports.VariablesCollection.add (~/.atom/packages/pigments/lib/variables-collection.coffee:173:10)
    at VariablesCollection.module.exports.VariablesCollection.addMany (~/.atom/packages/pigments/lib/variables-collection.coffee:179:14)
    at VariablesCollection.module.exports.VariablesCollection.updatePathCollection (~/.atom/packages/pigments/lib/variables-collection.coffee:144:16)
    at VariablesCollection.module.exports.VariablesCollection.updateCollection (~/.atom/packages/pigments/lib/variables-collection.coffee:111:40)
    at ~/.atom/packages/pigments/lib/color-project.coffee:236:18`

Thanks for the response!

Jeoxs commented 7 years ago

Greetings,

I have the same problem having this spec:

Atom Version: 1.11.2 Electron Version: 1.4.4-1 System: Arch Linux 64 bits Pigments Package: v0.38.0

This bug didn't happen with Atom 1.7.3 and pigments v0.37.0. When installed, the pigments doesn't show on the Atom Package Menu.

FlorianWendelborn commented 7 years ago

Same issues here on macOS Sierra with atom 1.12.1 and pigments 0.38.0.

EDIT: re-installing by removing the package folder manually fixed this for me. It also installed 0.37.0 instead afterwards.

Cxarli commented 7 years ago

I'm running Atom 1.13.0-beta1 with Pigments 0.38.0 on Linux 4.4.0 (Ubuntu 16.04), and I don't have this problem. Seems that an older version of Atom is the problem?

guidolarosa commented 7 years ago

@C-Bouthoorn I'll try installing the beta version of Atom and I come back to you.

guidolarosa commented 7 years ago

@C-Bouthoorn Hey! I tried running the Beta and it still doesn't work after reinstalling it. Atom displays the same issue "ColorContext is not a constructor". Could be a problem of my configuration?

Thanks.

Cxarli commented 7 years ago

It might be that something went wrong while installing pigments. Could you try re-installing (Also check the .apm folder for leftover pigments files)

guidolarosa commented 7 years ago

@C-Bouthoorn Yeah i tried installing it through the UI and with the console with apm, several times, but still doesn't work. Hope you can find a solution soon.

Bye!

abe33 commented 7 years ago

@guidolarosa Have you tried installing version 0.37 from the console using apm install pigments@0.37.0?

guidolarosa commented 7 years ago

@abe33 well i tried it just now and still it doesn' work. I tried it on Atom Beta and Atom, none of them work. When I reload pigments it still shows this error message:

Atom Version: 1.13.0-beta4 Electron Version: 1.3.9 System: Mac OS X 10.10 Thrown From: pigments package, v0.38.0

Stack Trace

Uncaught TypeError: ColorContext is not a constructor

At /Users/GuidoLaRosa/.atom/packages/pigments/lib/variables-collection.coffee:240

TypeError: ColorContext is not a constructor
    at VariablesCollection.module.exports.VariablesCollection.getContext (/Users/GuidoLaRosa/.atom/packages/pigments/lib/variables-collection.coffee:240:9)
    at ColorProject.module.exports.ColorProject.getContext (/Users/GuidoLaRosa/.atom/packages/pigments/lib/color-project.coffee:425:29)
    at ColorProject.module.exports.ColorProject.findAllColors (/Users/GuidoLaRosa/.atom/packages/pigments/lib/color-project.coffee:246:17)
    at /Users/GuidoLaRosa/.atom/packages/pigments/lib/pigments.coffee:93:37
    at Workspace.module.exports.Workspace.openURIInPane (/Users/GuidoLaRosa/Downloads/Atom Beta.app/Contents/Resources/app.asar/src/workspace.js:501:22)
    at Object.findColors (/Users/GuidoLaRosa/.atom/packages/pigments/lib/pigments.coffee:238:20)
    at atom-workspace.atom.commands.add.pigments:find-colors (/Users/GuidoLaRosa/.atom/packages/pigments/lib/pigments.coffee:24:35)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Users/GuidoLaRosa/Downloads/Atom Beta.app/Contents/Resources/app.asar/src/command-registry.js:259:29)
    at /Users/GuidoLaRosa/Downloads/Atom Beta.app/Contents/Resources/app.asar/src/command-registry.js:3:59
    at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/Users/GuidoLaRosa/Downloads/Atom Beta.app/Contents/Resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:210:32)
    at CommandPaletteView.module.exports.SelectListView.confirmSelection (/Users/GuidoLaRosa/Downloads/Atom Beta.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
    at space-pen-li.<anonymous> (/Users/GuidoLaRosa/Downloads/Atom Beta.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:139:19)
    at HTMLOListElement.dispatch (/Users/GuidoLaRosa/Downloads/Atom Beta.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
    at HTMLOListElement.elemData.handle (/Users/GuidoLaRosa/Downloads/Atom Beta.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)

Commands

     -1:33.6.0 editor:newline (input.hidden-input)
     -1:32.4.0 core:backspace (input.hidden-input)
     -1:26.5.0 command-palette:toggle (input.hidden-input)
     -1:22.9.0 core:move-down (input.hidden-input)
     -1:22.5.0 core:confirm (input.hidden-input)
     -1:22.5.0 pigments:reload (input.hidden-input)
     -1:11.3.0 core:select-all (atom-notification.error.icon.icon-flame.native-key-bindings.has-detail.has-close.has-stack)
     -1:09.9.0 core:copy (atom-notification.error.icon.icon-flame.native-key-bindings.has-detail.has-close.has-stack)
     -0:04.7.0 command-palette:toggle (input.hidden-input)
     -0:00.4.0 pigments:find-colors (input.hidden-input)

Config

{
  "core": {
    "disabledPackages": [
      "autocomplete-html",
      "dev-live-reload",
      "language-c",
      "language-csharp",
      "autocomplete-css",
      "preview-plus",
      "language-go",
      "language-java",
      "language-less",
      "language-make",
      "language-objective-c",
      "language-php",
      "language-python",
      "language-ruby",
      "language-ruby-on-rails",
      "language-sass",
      "language-toml",
      "metrics",
      "webbox-color",
      "autocomplete-atom-api",
      "autocomplete-snippets"
    ],
    "ignoredNames": [
      "*.ds"
    ],
    "telemetryConsent": "limited",
    "themes": [
      "one-dark-ui",
      "gaia-dark-syntax"
    ]
  },
  "pigments": {
    "delayBeforeScan": 200,
    "extendAutocompleteToColorValue": true,
    "extendedSearchNames": [
      "**/*.styl"
    ],
    "groupPaletteColors": "by file",
    "markerType": "background",
    "sortPaletteColors": "by color"
  }
}

Installed Packages

# User
afterglow-monokai-syntax, v1.3.4 (inactive)
alpenglow-atom-syntax, v0.0.3 (inactive)
alpenglow-monokai-atom-syntax, v0.0.6 (inactive)
atom-bootstrap3, v1.2.12 (inactive)
expose, v0.12.2 (inactive)
file-icons, v1.7.25 (active)
gaia-dark-syntax, v1.1.0 (active)
gloom, v0.3.4 (inactive)
language-pug, v0.0.19 (active)
minimap, v4.26.3 (active)
monokai-complete-syntax, v0.2.3 (inactive)
nucleus-dark-ui, v0.10.15 (inactive)
package-cop, v0.2.10 (active)
pigments, v0.38.0 (active)
preview-plus, v1.2.7 (inactive)
seti-ui, v1.3.2 (inactive)
Stylus, v3.1.0 (active)
todo-show, v1.8.0 (inactive)
atom-dark-syntax, v0.28.0 (inactive)
atom-dark-ui, v0.53.0 (inactive)
atom-light-syntax, v0.29.0 (inactive)
atom-light-ui, v0.46.0 (inactive)
base16-tomorrow-dark-theme, v1.4.0 (inactive)
base16-tomorrow-light-theme, v1.4.0 (inactive)
one-dark-ui, v1.8.2 (active)
one-light-ui, v1.8.2 (inactive)
one-dark-syntax, v1.6.0 (inactive)
one-light-syntax, v1.6.0 (inactive)
solarized-dark-syntax, v1.1.1 (inactive)
solarized-light-syntax, v1.1.1 (inactive)
about, v1.7.2 (active)
archive-view, v0.62.0 (active)
autocomplete-atom-api, v0.10.0 (inactive)
autocomplete-css, v0.14.1 (inactive)
autocomplete-html, v0.7.2 (inactive)
autocomplete-plus, v2.33.1 (active)
autocomplete-snippets, v1.11.0 (inactive)
autoflow, v0.29.0 (inactive)
autosave, v0.23.2 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.43.2 (active)
bracket-matcher, v0.82.2 (active)
command-palette, v0.39.1 (active)
deprecation-cop, v0.55.1 (active)
dev-live-reload, v0.47.0 (inactive)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.40.0 (active)
find-and-replace, v0.204.2 (inactive)
fuzzy-finder, v1.4.0 (active)
git-diff, v1.2.0 (active)
go-to-line, v0.31.2 (inactive)
grammar-selector, v0.48.2 (active)
image-view, v0.60.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.1 (active)
link, v0.31.2 (inactive)
markdown-preview, v0.159.1 (active)
metrics, v1.1.2 (inactive)
notifications, v0.65.1 (active)
open-on-github, v1.2.1 (inactive)
package-generator, v1.0.2 (inactive)
settings-view, v0.244.0 (active)
snippets, v1.0.4 (active)
spell-check, v0.68.5 (active)
status-bar, v1.6.0 (active)
styleguide, v0.48.0 (active)
symbols-view, v0.113.1 (inactive)
tabs, v0.103.1 (active)
timecop, v0.33.2 (active)
tree-view, v0.211.1 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.35.1 (active)
whitespace, v0.35.0 (active)
wrap-guide, v0.39.0 (active)
language-c, v0.54.0 (inactive)
language-clojure, v0.22.1 (active)
language-coffee-script, v0.48.1 (active)
language-csharp, v0.13.0 (inactive)
language-css, v0.40.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.43.0 (inactive)
language-html, v0.46.1 (active)
language-hyperlink, v0.16.1 (active)
language-java, v0.24.0 (inactive)
language-javascript, v0.122.0 (active)
language-json, v0.18.3 (active)
language-less, v0.29.6 (inactive)
language-make, v0.22.2 (inactive)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (inactive)
language-perl, v0.37.0 (active)
language-php, v0.37.3 (inactive)
language-property-list, v0.8.0 (active)
language-python, v0.45.1 (inactive)
language-ruby, v0.70.2 (inactive)
language-ruby-on-rails, v0.25.1 (inactive)
language-sass, v0.57.0 (inactive)
language-shellscript, v0.23.0 (active)
language-source, v0.9.0 (active)
language-sql, v0.25.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.29.1 (active)
language-toml, v0.18.1 (inactive)
language-xml, v0.34.12 (active)
language-yaml, v0.27.1 (active)

# Dev
No dev packages

`

abe33 commented 7 years ago

@guidolarosa Actually you still have v0.38 installed, you might probably need to apm uninstall pigments then apm install pigments@0.37.0

guidolarosa commented 7 years ago

Hey @abe33 ! Yes but I installed 0.37.0 throught apm and Atom. Didn't work either...