Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue "Failed to activate the pigments package #17" closed prematurely #201

Closed
blogscot opened this issue Jun 28, 2016 · 19 comments
Closed

Comments

@blogscot
Copy link

blogscot commented Jun 28, 2016

For months now I've been seeing error reports immediately after updating the 'pigments' package. Atom tells me that this problem has already reported. When I checked, the last comment raised was 4 days ago, however this issue was marked as closed in May 2015. Alas, after browsing through the ever growing list of comments on this closed issue it is clear that something is still broken.

@abe33
Copy link
Owner

abe33 commented Jun 28, 2016

Hi @blogscot, I'm well aware of how annoying it can be, and have made many attempt in the past to find a proper solution, but there's not at the time.

I already explained several times what generally cause this issue, and why it keeps occurring, but I'll reiterate my explanations since they're now buried in the thread.

Pigments, as probably many other packages, is separated into several files that are loaded through the node's require function. That means that these files are submitted to the node modules cache. When a package gets updated from within Atom, the package's main file is reloaded after the updates so that the new code can be loaded. But unfortunately, it's not the case for the other files which are still in the node's cache. If there's any changes in the API (a common scenario for an update) it'll break. And if it breaks during the package's activation, it'll end up filling the #17 issue. I opened a PR for that (see atom/atom#10035) but it was not considered for merge due to issues with native modules. Note that the issue can be worse if the package use custom elements in that even if the elements are defined in the package's main file, there is no mechanism in HTML to remove/update a previously registered element, so the same problem of API compatibility can arise with UI elements.
When there's really an issue with the package itself (other than those due to what I describe above) the TravisCI build will generally break so it's always a good thing to check whether the README badge is green or red.

To prevent any risk of a compatibility issue after an update I always update from the CLI using apm update

As for why I don't reopen the issue, I consider that since the original cause of the mentioned issue was fixed the github issue should be closed. The annoying thing is that the Atom reporter rely on the error message to find an existing issue, but since the message in case of a package activation error is always the same everybody gets redirected to that issue, even if the root cause is completely different. Ideally different causes should be addressed in different issues.

@paul-howard
Copy link

Thanks for the explanation, @abe33. I just ran into this issue while updating to 0.34.0. (FWIW, the "View this issue" button took me straight here instead of to #17.)

To offer a bit of a TL;DR for future visitors to this issue: there's no real problem here—simply quit and restart Atom and the Pigments package should go back to functioning normally. To avoid the issue going forward, prefer apm update on the command line to updating packages in the GUI.

@nemzes
Copy link

nemzes commented Aug 30, 2016

Would it be possible to avoid the problems mentioned in atom/atom#10035 by having a new, optional flag in a package's manifest that makes that package be disabled/reenabled during upgrade? Or does this already happen?

@neontapir
Copy link

Is there a way Paul's restart advice could be added to the package load error message?

@hakamibrahim
Copy link

I updated this and have an error message

@jameswlane
Copy link

  1. Update Pigments

Atom Version: 1.10.0
Electron Version: 0.37.8
System: Mac OS X 10.11.6
Thrown From: pigments package, v0.34.0

Stack Trace

Failed to activate the pigments package

At _this.mainModule[methodName] is not a function

TypeError: _this.mainModule[methodName] is not a function
  at Object.atom.deserializers.add.deserialize [as deserialize] (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:454:52)
  at DeserializerManager.module.exports.DeserializerManager.deserialize (/Applications/Atom.app/Contents/Resources/app.asar/src/deserializer-manager.js:45:29)
  at Object.module.exports.activate (/Users/jl82576/.atom/packages/pigments/lib/pigments.coffee:56:8)
  at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:183:20)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:156:32
  at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:92:15)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:149:26
  at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:146:34)
  at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:538:21)
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-manager.js:397:31

Commands

     -0:41.9.0 settings-view:check-for-package-updates (atom-workspace.workspace.scrollbars-visible-always.seti-ui-no-icons.theme-one-dark-syntax.theme-one-dark-ui)

Config

{
  "core": {
    "customFileTypes": {
      "source.ini": [
        ".buckconfig",
        ".flowconfig"
      ],
      "source.json": [
        ".arcconfig",
        "BUCK.autodeps"
      ],
      "source.python": [
        "BUCK"
      ]
    },
    "disabledPackages": [
      "hyperclick",
      "nuclide-arcanist",
      "nuclide-blame",
      "nuclide-blame-provider-hg",
      "nuclide-blame-ui",
      "nuclide-buck-files",
      "nuclide-clang-atom",
      "nuclide-code-format",
      "nuclide-debugger-atom",
      "nuclide-debugger-hhvm",
      "nuclide-debugger-lldb",
      "nuclide-diagnostics-store",
      "nuclide-diagnostics-ui",
      "nuclide-diff-view",
      "nuclide-file-tree",
      "nuclide-file-watcher",
      "nuclide-find-references",
      "nuclide-flow",
      "nuclide-format-js",
      "nuclide-fuzzy-filename-provider",
      "nuclide-hack",
      "nuclide-hack-symbol-provider",
      "nuclide-hg-repository",
      "nuclide-installer",
      "nuclide-language-hack",
      "nuclide-move-pane",
      "nuclide-objc",
      "nuclide-ocaml",
      "nuclide-open-filenames-provider",
      "nuclide-quick-open",
      "nuclide-remote-projects",
      "nuclide-test-runner",
      "nuclide-toolbar",
      "nuclide-type-hint",
      "tree-view",
      "activate-power-mode"
    ],
    "projectHome": "/Workbench"
  }
}

Installed Packages

# User
achieve-atom, v0.7.0 (inactive)
achievements, v0.9.0 (active)
achiever, v0.1.1 (active)
advanced-new-file, v0.5.0 (inactive)
atom-beautify, v0.29.10 (inactive)
atom-bootstrap3, v1.2.12 (inactive)
atom-lcov, v2.0.0 (inactive)
atom-monokai, v0.10.4 (inactive)
atom-ternjs, v0.14.2 (inactive)
auto-detect-indentation, v1.2.0 (active)
autoclose-html, v0.23.0 (active)
autocomplete-modules, v1.6.1 (active)
autocomplete-paths, v1.0.2 (active)
autocomplete-sass, v0.1.0 (active)
change-case, v0.6.3 (active)
clipboard-history, v0.6.6 (inactive)
color-picker, v2.2.2 (active)
compare-files, v0.8.0 (inactive)
css-snippets, v1.0.0 (active)
ctags-status, v1.3.5 (active)
duotone-dark-syntax, v1.0.0 (inactive)
duplicate-line-or-selection, v0.5.0 (inactive)
editorconfig, v1.4.1 (active)
file-icons, v1.7.19 (inactive)
file-templates, v0.2.0 (inactive)
fonts, v1.6.0 (active)
gist-it, v0.9.1 (inactive)
git-control, v0.8.2 (inactive)
git-diff-details, v1.3.0 (active)
git-plus, v5.16.2 (inactive)
git-projects, v1.17.0 (inactive)
git-tab-status, v1.9.2 (active)
git-time-machine, v1.5.3 (inactive)
goto-definition, v1.1.19 (active)
hashrocket, v0.4.10 (active)
haskell-grammar, v0.4.0 (active)
highlight-selected, v0.11.2 (active)
javascript-snippets, v1.2.1 (active)
jquery-snippets, v11.0.0 (active)
js-refactor, v0.7.3 (active)
language-babel, vundefined (active)
language-docker, v1.1.7 (active)
language-ini, v1.16.0 (active)
language-javascript-jsx, v0.3.7 (active)
language-ocaml, v1.1.2 (active)
language-swift, v0.4.0 (active)
language-thrift, v1.0.2 (active)
linter, v1.11.16 (active)
linter-eslint, v7.2.4 (active)
linter-ruby, v1.2.2 (active)
linter-scss-lint, v3.0.4 (active)
merge-conflicts, v1.4.4 (active)
minimap, v4.25.0 (active)
minimap-find-and-replace, v4.5.1 (active)
minimap-git-diff, v4.3.1 (active)
minimap-highlight-selected, v4.4.0 (active)
minimap-pigments, v0.2.1 (active)
mocha-test-runner, v0.5.1 (inactive)
mocha-ui, v0.1.8 (inactive)
monokai-seti, v0.7.0 (inactive)
node-debugger, vundefined (active)
nucleus-dark-ui, v0.9.3 (inactive)
nuclide, v0.165.0 (active)
open-recent, v5.0.0 (active)
pigments, v0.34.0 (inactive)
pomodoro, v1.0.1 (inactive)
project-manager, v2.9.7 (active)
react, v0.16.0 (active)
react-snippets, v0.4.2 (active)
refactor, v0.9.2 (active)
save-session, v0.16.0 (active)
set-syntax, v0.3.0 (active)
seti-syntax, v1.0.1 (inactive)
seti-ui, v1.3.2 (inactive)
sort-lines, v0.14.0 (inactive)
tabs-to-spaces, v1.0.2 (active)
terminal-plus, v0.14.5 (active)
terminal-status, v1.6.8 (active)
test-status, v1.0.0 (active)
tidy-tabs, v0.3.0 (active)
time-status, v1.1.2 (active)
todo-show, v1.7.0 (inactive)
toggle-quotes, v1.0.0 (inactive)
tool-bar, v1.0.1 (active)
trailing-spaces, v0.3.2 (active)
tree-view-git-projects, v0.5.0 (active)
tree-view-git-status, v1.1.0 (active)
turbo-javascript, v1.4.0 (inactive)
underscorejs-snippets, v0.2.2 (active)
webbox-color, v0.5.9 (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.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.5.0 (active)
one-light-ui, v1.5.0 (inactive)
one-dark-syntax, v1.3.0 (active)
one-light-syntax, v1.3.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.5.3 (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.41.0 (active)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.39.0 (active)
find-and-replace, v0.201.0 (inactive)
fuzzy-finder, v1.3.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (active)
image-view, v0.58.2 (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, v0.53.1 (active)
notifications, v0.65.0 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.241.2 (active)
snippets, v1.0.2 (active)
spell-check, v0.67.1 (active)
status-bar, v1.4.1 (active)
styleguide, v0.47.0 (active)
symbols-view, v0.113.0 (inactive)
tabs, v0.100.2 (active)
timecop, v0.33.2 (active)
tree-view, v0.208.2 (inactive)
update-package-dependencies, v0.10.0 (active)
welcome, v0.34.0 (active)
whitespace, v0.33.0 (active)
wrap-guide, v0.38.1 (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

@aewshyae
Copy link

aewshyae commented Sep 9, 2016

Atom reboot makes it well after this error occurs! yay!
I hope it helps.

@Cxarli
Copy link
Collaborator

Cxarli commented Sep 10, 2016

@mystrdat That's because of the way Atom works with updating packages. pigments is definitely not the only plugin that has this problem, and there is already an issue on the Atom repo.

Restarting Atom should fix this problem. To prevent it in the future, update your packages with apm update.

@bronson
Copy link

bronson commented Nov 7, 2016

Looks like this issue can be closed soon: atom/settings-view#851 Yay!

@dukegod
Copy link

dukegod commented Jan 10, 2017

change ‘Marker Type’ value.
if i select 'gutter' ,it will be an error.
select other options , it is ok

@Cxarli
Copy link
Collaborator

Cxarli commented Jan 14, 2017

Closed because it seems to be fixed.

@Cxarli Cxarli closed this as completed Jan 14, 2017
@JanCVanB
Copy link

JanCVanB commented Mar 7, 2017

I got the following error on every Atom start-up:

Failed to activate the pigments package

Cannot find module event-kit

Un-installing and re-installing the pigments package fixed it for me. 👍

(the "View Issue" button sent me here)

@BykovDenis
Copy link

BykovDenis commented May 3, 2017

Cannot read property 'length' of undefined
Hide Stack Trace
TypeError: Cannot read property 'length' of undefined
    at Function.Module._resolveLookupPaths (module.js:305:23)
    at Module._resolveFilename (module.js:446:31)
    at Module._resolveFilename (C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\electron.asar\common\reset-search-paths.js:35:12)
    at Function.get_Module._resolveFilename (C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\module-cache.js:354:1)
    at Module.require (file:///C:/Users/xxx/AppData/Local/atom/app-1.17.0-beta4/resources/app/static/index.js:40:43)
    at require (C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\native-compile-cache.js:66:1)
    at requireCore (file:///C:/Users/xxx/.atom/packages/pigments/lib/pigments.coffee:304:7)
    at Object.patchAtom (file:///C:/Users/xxx/.atom/packages/pigments/lib/pigments.coffee:306:26)
    at Object.activate (file:///C:/Users/xxx/.atom/packages/pigments/lib/pigments.coffee:116:6)
    at Package.module.exports.Package.activateNow (C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\package.js:253:1)
    at C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\package.js:225:1
    at Package.module.exports.Package.measure (C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\package.js:99:1)
    at C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\package.js:218:1
    at Package.module.exports.Package.activate (C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\package.js:215:1)
    at PackageManager.module.exports.PackageManager.activatePackage (C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\package-manager.js:642:1)
    at C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\package-manager.js:623:1
    at Config.module.exports.Config.transactAsync (C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\config.js:346:1)
    at PackageManager.module.exports.PackageManager.activatePackages (C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\package-manager.js:618:1)
    at PackageManager.module.exports.PackageManager.activate (C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\package-manager.js:600:1)
    at C:\Users\xxx\AppData\Local\atom\app-1.17.0-beta4\resources\app\src\atom-environment.js:832:1

@Julix91
Copy link

Julix91 commented May 16, 2017

Same here

Cannot read property 'length' of undefined
Hide Stack Trace
TypeError: Cannot read property 'length' of undefined
    at Function.Module._resolveLookupPaths (module.js:305:23)
    at Module._resolveFilename (module.js:446:31)
    at Module._resolveFilename (C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\electron.asar\common\reset-search-paths.js:35:12)
    at Function.get_Module._resolveFilename (C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\module-cache.js:354:1)
    at Module.require (file:///C:/Users/julix/AppData/Local/atom/app-1.17.0/resources/app/static/index.js:40:43)
    at require (C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\native-compile-cache.js:66:1)
    at requireCore (file:///C:/Users/julix/.atom/packages/pigments/lib/pigments.coffee:295:7)
    at Object.patchAtom (file:///C:/Users/julix/.atom/packages/pigments/lib/pigments.coffee:297:26)
    at Object.activate (file:///C:/Users/julix/.atom/packages/pigments/lib/pigments.coffee:16:6)
    at Package.module.exports.Package.activateNow (C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\package.js:253:1)
    at C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\package.js:225:1
    at Package.module.exports.Package.measure (C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\package.js:99:1)
    at C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\package.js:218:1
    at Package.module.exports.Package.activate (C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\package.js:215:1)
    at PackageManager.module.exports.PackageManager.activatePackage (C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\package-manager.js:642:1)
    at C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\package-manager.js:623:1
    at Config.module.exports.Config.transactAsync (C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\config.js:346:1)
    at PackageManager.module.exports.PackageManager.activatePackages (C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\package-manager.js:618:1)
    at PackageManager.module.exports.PackageManager.activate (C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\package-manager.js:600:1)
    at C:\Users\julix\AppData\Local\atom\app-1.17.0\resources\app\src\atom-environment.js:832:1

Edit: Works again after updating! :)

@shortercode
Copy link

Anyone landing here after the atom 1.17.0 update, updating pigments will fix the error.

@AdamDenoon
Copy link

AdamDenoon commented May 20, 2017

I have Atom 1.17.0 and Pigments 0.39.1 (on macOS Sierra 10.12.5). I have restarted Atom several times, and I've uninstalled Pigments and reinstalled it, and I'm still getting the same error as @BykovDenis and @Julix91 ("Cannot read property 'length' of undefined"). I cannot find any option for upgrading Pigments.

Edit: I got that error after restarting Atom THEN upgrading Pigments. Restarting Atom AFTER the upgrade solved it for me :)

@tgines
Copy link

tgines commented May 20, 2017

Restarting Atom AFTER the upgrade solved it for me.

This ☝️

@codylawson
Copy link

I was unable to install the update to pigments via the Atom updater. Instead used apm install pigments@0.39.1 to get the correct version.

@borishere
Copy link

Failed to activate the pigments package.
Cannot find 'highlights-component' in the require cache .

I get this error on atom start. 1.19.0-beta0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests