Closed derhuerst closed 9 years ago
What's your code like? Do you mean you type /[^A-Z]/i
or when you type any character matching that regex?
Any character matching that regex.
Ok I just was unsure because you called them special keys.
How are you using the plugin? Does running the example.js work for you?
How are you using the plugin?
In a pretty similar way.
Does running the example.js work for you?
No. I get the same error.
TypeError: Cannot read property 'name' of undefined
at Prompt.onKeypress (/Users/jannis/Web/inquirer-autocomplete-prompt/index.js:176:12)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1811:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1743:35)
at AnonymousObserver.tryCatcher (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:537:29)
at AutoDetachObserverPrototype.next (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:5421:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1743:35)
at AnonymousObserver._onNext (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:4069:15)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1811:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1743:35)
at AnonymousObserver.tryCatcher (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:537:29)
Actually, I found another bug. When I type arrow down
, I get the following.
ReferenceError: readline is not defined
at Prompt.onKeypress (/Users/jannis/Web/inquirer-autocomplete-prompt/index.js:181:5)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1811:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1743:35)
at AnonymousObserver.tryCatcher (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:537:29)
at AutoDetachObserverPrototype.next (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:5421:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1743:35)
at AnonymousObserver._onNext (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:4069:15)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1811:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1743:35)
at AnonymousObserver.tryCatcher (/Users/jannis/Web/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:537:29)
Actually I'm seeing this too. It happens with <
>
/
[
]
\
;
'
and . Maybe it's a bug in the
readline` library.
readline.js:913
stream[ESCAPE_DECODER].next(r[i]);
^
TypeError: Cannot read property 'name' of undefined
at Prompt.onKeypress (/Users/mike/wrk/code/inquirer-autocomplete-prompt/index.js:184:12)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/Users/mike/wrk/code/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1811:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/mike/wrk/code/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1743:35)
at AnonymousObserver.tryCatcher (/Users/mike/wrk/code/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:537:29)
at AutoDetachObserverPrototype.next (/Users/mike/wrk/code/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:5421:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/mike/wrk/code/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1743:35)
at AnonymousObserver._onNext (/Users/mike/wrk/code/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:4069:15)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/Users/mike/wrk/code/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1811:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/mike/wrk/code/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:1743:35)
at AnonymousObserver.tryCatcher (/Users/mike/wrk/code/inquirer-autocomplete-prompt/node_modules/inquirer/node_modules/rx-lite/rx.lite.js:537:29)
Seeing this on iojs 2.3 as well as after updating to the latest, 4.2.2
Just tested it on the basic readline example and that worked fine with those characters https://nodejs.org/api/readline.html
Fixed. was not so familiar with the event here and assumed all events had a e.key
. But for instance when typing /
it produced the following event: { value: '/', key: undefined }
Can you publish this package to npm so i can use it?
Done. https://www.npmjs.com/package/inquirer-autocomplete-prompt
I have kept a 0.X version for now, want to get proper testcases etc before giving it the 1.0.0
Still, should work as expected.
Thanks a lot!
Whenever I type something
/[^A-Z]/i
, it crashes withTypeError: Cannot read property 'name' of undefined
.