editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

Cannot find module 'codex-tooltip', 'codex-notifier'

Open rajmondx opened this issue 2 years ago • 1 comments

Steps to reproduce:

  1. Install the package npm install --save @editorjs/editorjs (version: ^2.27.0)
  2. Use it somewhere eg. import EditorJS from '@editorjs/editorjs';
  3. Enjoy error logs:
Error: node_modules/@editorjs/editorjs/types/api/notifier.d.ts:1:78 
    \ - error TS2307: Cannot find module 'codex-notifier' or its corresponding type declarations.

1 import {ConfirmNotifierOptions, NotifierOptions, PromptNotifierOptions} from 'codex-notifier';
                                                                               ~~~~~~~~~~~~~~~~

Error: node_modules/@editorjs/editorjs/types/api/tooltip.d.ts:4:46 
    \ - error TS2307: Cannot find module 'codex-tooltip' or its corresponding type declarations.  

4 import {TooltipContent, TooltipOptions} from 'codex-tooltip';
                                               ~~~~~~~~~~~~~~~

It's caused because both packages are used as dev-dependencies so they wont be installed with npm install --save @editorjs/editorjs.

Current workaround is to manually npm install both packages as root dependencies (of course the same version as editorjs requires), which causes some typescript warning about unused ts compilation parts (its probably possible to exclude them in tsconfig.json).

I'm not sure if I'm doing something wrong here, because this bug should have been already known since I'm very likely not the only one using editorjs with typescript.

rajmondx avatar Jun 21 '23 12:06 rajmondx

I have the exact issue on "@editorjs/editorjs": "^2.29.1", and yes I needed to manually install both codex-notifier and codex-tooltip in my Angular project

Romanizat avatar Apr 06 '24 09:04 Romanizat

Resolved by #2842

neSpecc avatar Nov 06 '24 18:11 neSpecc