hyper-tabs-enhanced
hyper-tabs-enhanced copied to clipboard
TypeError: title.match is not a function
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)
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.
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'
},
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)
Same error here...
Removing "hyper-tab-icons" plugin had worked for me
There are cases where this.props.text
as provided by exports.decorateTab
is an entire React element instead of a plain string.
This only seems to happen for me when I have more than one tab open.