Uncaught (in promise) TypeError: this.item.getTitle is not a function


#1

I’m creating a view to open on a Tab with my html content, but this error appears:

~\AppData\Local\atom\app-1.16.0\resources\app.asar\node_modules\tabs\lib\tab-view.js:310 Uncaught (in promise) TypeError: this.item.getTitle is not a function

This is my code:

MenuPartView = require './menu-part-view'
PagebuilderURI = 'atom://pagebuilder' 
[...]
activate: (state) ->
    @menuView = new MenuPartView()
    @bottomPanel = atom.workspace.addBottomPanel(item: @menuView, visible: true)
    @subscriptions = new CompositeDisposable

    @subscriptions.add atom.workspace.addOpener (filePath) =>
    @showPagebuilderView(uri: PagebuilderURI) if filePath is PagebuilderURI

    @subscriptions.add atom.commands.add 'atom-workspace', 'pagebuilder:toggle': ->
        atom.workspace.open(PagebuilderURI)

showPagebuilderView: (state) ->
    PagebuilderView = require './menu-part-view'
    new MenuPartView(state)

OBS: using etch!


#2

You need a function that just returns the title of the tab, as demonstrated here.


#3

That’s it! Very thanks.