Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

TypeError: title.match is not a function #37

Open
alicanb opened this issue Sep 13, 2018 · 6 comments
Open

TypeError: title.match is not a function #37

alicanb opened this issue Sep 13, 2018 · 6 comments

Comments

@alicanb
Copy link

alicanb commented Sep 13, 2018

Hi there, I'm on WSL running canary build, below is the error I get:

TypeError: title.match is not a function
    at getIcon (C:\Users\alicanb\.hyper_plugins\node_modules\hyper-tabs-enhanced\index.js:306:27)
    at Object.render (C:\Users\alicanb\.hyper_plugins\node_modules\hyper-tabs-enhanced\index.js:314:26)
@ChrisNoel
Copy link

ChrisNoel commented Nov 11, 2018

Hey mate,

Looks like the title argument passed to getIcon(title) is not always a string, if its not a string calling the match function on the argument is going to fail.

My solution was to call toString on the argument and then chaining match on the end, like so ->

// Current process icon
const getIcon = (title) => {
    const process = title.toString().match(/(?:[\s]+|^)(gulp|php|node|npm|yarn|vim|nvim|python|mysql)(?:[\s]+|$)/i);
    return process ? process[0].trim().toLowerCase() : 'shell';
};

That solved the problem. There is probably a better way to do this... I will let the maintainers make that call though.

ChrisNoel pushed a commit to ChrisNoel/hyper-tabs-enhanced that referenced this issue Nov 11, 2018
@creativedrewy
Copy link

creativedrewy commented Feb 12, 2019

Unfortunately I'm still seeing this error! Hyper 2.1.2 stable, here is the hypertabs config section:

    hyperTabs: {
      border: true,
      tabIconsColored: true,
      activityColor: 'red',
      closeAlign: 'right'
    },

@DineshCyanam
Copy link

See the same errror on Hyper 2.1.2 as @creativedrewy

[Notification] Plugin error: Plugins decorating Tab has been disabled because of a plugin crash. Check Developer Tools for details.

bundle.js:1 TypeError: title.match is not a function at getIcon (/Users/cyanam/.hyper_plugins/node_modules/hyper-tabs-enhanced/index.js:306:27) at Object.render (/Users/cyanam/.hyper_plugins/node_modules/hyper-tabs-enhanced/index.js:314:26) at h (file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js:1:154527) at beginWork (file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js:1:156264) at d (file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js:1:168739) at f (file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js:1:169079) at g (file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js:1:169330) at m (file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js:1:172850) at w (file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js:1:172644) at z (file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js:1:171749)

@mitchellsolomon
Copy link

Same error here...
Screen Shot 2019-04-18 at 2 04 30 AM

@jankrloz
Copy link

jankrloz commented May 1, 2019

Removing "hyper-tab-icons" plugin had worked for me

@ryanjwessel
Copy link

ryanjwessel commented Dec 18, 2019

There are cases where this.props.text as provided by exports.decorateTab is an entire React element instead of a plain string.

Screen Shot 2019-12-18 at 13 56 12

This only seems to happen for me when I have more than one tab open.

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

No branches or pull requests

7 participants