diff --git a/src/parse-keypress.ts b/src/parse-keypress.ts index b52059ea..130fab98 100644 --- a/src/parse-keypress.ts +++ b/src/parse-keypress.ts @@ -88,7 +88,7 @@ const keyName: Record = { '[7^': 'home', '[8^': 'end', /* misc. */ - '[Z': 'tab' + '[Z': 'tab', }; export const nonAlphanumericKeys = [...Object.values(keyName), 'backspace']; @@ -106,7 +106,7 @@ const isShiftKey = (code: string) => { '[6$', '[7$', '[8$', - '[Z' + '[Z', ].includes(code); }; @@ -122,7 +122,7 @@ const isCtrlKey = (code: string) => { '[5^', '[6^', '[7^', - '[8^' + '[8^', ].includes(code); }; @@ -160,7 +160,7 @@ const parseKeypress = (s: Buffer | string = ''): ParsedKey => { shift: false, option: false, sequence: s, - raw: s + raw: s, }; key.sequence = key.sequence || s || key.name; diff --git a/src/reconciler.ts b/src/reconciler.ts index 1738f737..dc09247d 100644 --- a/src/reconciler.ts +++ b/src/reconciler.ts @@ -26,10 +26,13 @@ if (process.env['DEV'] === 'true') { try { await import('./devtools.js'); } catch (error: any) { - if (error.code === 'MODULE_NOT_FOUND') { + if (error.code === 'ERR_MODULE_NOT_FOUND') { console.warn( ` -Debugging with React Devtools requires \`react-devtools-core\` dependency to be installed. +The environment variable DEV is set to true, so Ink tried to import \`react-devtools-core\`, +but this failed as it was not installed. Debugging with React Devtools requires it. + +To install use this command: $ npm install --save-dev react-devtools-core `.trim() + '\n',