atom-community/tool-bar

Failed to activate the tool-bar package

SomeDevWeb opened this issue · 4 comments

Hi all.
I am working on an electron app using Atom and one of the things I want to implement (and can't by the way) is a toolbar at the top of the app that always stays on top of all the windows.

I added 2files for that in the root of my project: a toolbar.html and toolbar.js.
After that I got these error coming all the time.

Could not load your toolbar from C:\Users\User.atom\toolbar.cson

Now changed my files name to "top_bar" html and js but I still get this error.
It's no big deal cause the rest of functionality is still ok, but it's still an error that I thought should be reported.

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.44.0 x64
Electron: 4.2.7
OS: Microsoft Windows 10 Home
Thrown From: tool-bar package 1.2.0

Stack Trace

Failed to activate the tool-bar package

At Cannot read property 'addEventListener' of null

TypeError: Cannot read property 'addEventListener' of null
    at Object.<anonymous> (~/electron-quick-start/toolbar.js:5:41)
    at Object.<anonymous> (~/electron-quick-start/toolbar.js:19:3)
    at Module.get_Module._compile (<embedded>:11:147429)
    at Object.value [as .js] (<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (<embedded>:11:146745)
    at Object.loadConfig (/packages/flex-tool-bar/lib/flex-tool-bar.js:715:19)
    at Object.reloadToolbar (/packages/flex-tool-bar/lib/flex-tool-bar.js:491:30)
    at Object.consumeToolBar (/packages/flex-tool-bar/lib/flex-tool-bar.js:475:8)
    at Provider.provide (<embedded>:14:1121906)
    at ServiceHub.provide (<embedded>:11:3314762)
    at Package.activateServices (<embedded>:11:3323048)
    at Package.activateNow (<embedded>:11:3320024)
    at measure (<embedded>:11:3319348)
    at Package.measure (<embedded>:11:3316958)
    at activationPromise.activationPromise.Promise (<embedded>:11:3319208)
    at new Promise (<anonymous>:null:null)
    at Package.activate (<embedded>:11:3319151)
    at PackageManager.activatePackage (<embedded>:11:382452)
    at config.transactAsync (<embedded>:11:382068)
    at Config.transactAsync (<embedded>:11:331716)
    at PackageManager.activatePackages (<embedded>:11:382018)
    at PackageManager.activate (<embedded>:11:381568)
    at t.loadState.then (<embedded>:1:756241)

Commands

     -0:29.1.0 sync-settings:restore (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)

Non-Core Packages

atom-beautify 0.33.4 
atom-formatter-jsbeautify 1.1.2 
atom-ftp-editor 0.5.0 
atom-html-preview 0.2.6 
block-comment 0.4.3 
block-comment-plus 0.5.1 
color-picker 2.3.0 
comment 0.6.1 
compare-files 0.8.1 
emmet 2.4.3 
flex-tool-bar 2.1.4 
goto-definition 1.3.4 
php-cs-fixer 4.1.1 
platformio-ide-terminal 2.10.0 
project-plus 1.0.0 
remote-ftp 2.2.4 
sass-autocompile 0.13.5 
sync-settings 4.1.0 
tool-bar 1.2.0 
tool-bar-main 0.0.12 

I'm not entirely sure if you have the problem when using Atom or when developing your own electron app that is not Atom (or is it an electron app that you based on/forked from Atom, or is it based on electron-quick-start)? Could you clarify?

If you're trying to use this outside of Atom, then I don't think you should expect things to work out of the box as this project is package for Atom. Atom is most likely the thing that is providing the object on which the toolbar tries to call addEventListener. But because it is not running in Atom it is null.

Could not load your toolbar from C:\Users\User.atom\toolbar.cson

Is that a typo or is that actually what it says? Because that should be:

- C:\Users\User.atom\toolbar.cson
+ C:\Users\User\.atom\toolbar.cson

If it is a typo, then, are you sure there is a file named toolbar.cson in C:\Users\User\.atom?

if it helps
i got
Atom: 1.44.0 x64 [Portable]
OS: Microsoft Windows 10 pro x64
tool-bar package 1.2.0
no problems

Hi and sorry for the delay.

I am building an electron app based on "electron-quick-start", but I am using Atom as an editor.
In fact I am using Atom for other web projects and it works fine.

Just when I created the "toolbar.html" and "toolbar.js" files in my root folder I got this error starting to pop-up. Also I looked and I have the "toolbar.cson" file in the C:\Users\User.atom folder.

Sorry, that's a typo, yes. It says:
Could not load your toolbar from C:\Users\User.atom\toolbar.cson

Well, I eventually renamed the 2 files "top_bar" .html and .js and now I get no more errors, so there's got to be a naming issue.

Ayway, it's no big deal, but maybe it helps someone else that runs into this issue to not name the electron internal files "toolbar"...

Thanks.

suda commented

Thanks for the clarification! As this is not directly related to regular usage of tool-bar, I'll close this issue. If anyone would look for this info they could still find this issue :)