Skip to content

Commit

Permalink
Updated error code to work with ESM modules (see: nodejs/modules#360)…
Browse files Browse the repository at this point in the history
…. Added message about the env var.
  • Loading branch information
bn-l committed Mar 19, 2024
1 parent 1682444 commit 5fa7b2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/reconciler.ts
Expand Up @@ -26,10 +26,11 @@ 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 = 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'
Expand Down

0 comments on commit 5fa7b2a

Please sign in to comment.