editor.js: [Bug] Compilation error with Angular 13

Error: node_modules/@editorjs/editorjs/types/api/tooltip.d.ts:4:9 - error TS2614: Module '"codex-tooltip"' has no exported member 'TooltipContent'. Did you mean to use 'import TooltipContent from "codex-tooltip"' instead?

Error: node_modules/@editorjs/editorjs/types/api/tooltip.d.ts:4:25 - error TS2614: Module '"codex-tooltip"' has no exported member 'TooltipOptions'. Did you mean to use 'import TooltipOptions from "codex-tooltip"' instead?

Steps to reproduce:

  1. import EditorJS from '@editorjs/editorjs';
  2. this._editor = new EditorJS({holder: this.id});

Editor.js version: 2.22.2

Angular version: 13.0.2

Plugins you use with their versions: none

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 9
  • Comments: 15 (1 by maintainers)

Commits related to this issue

Most upvoted comments

same issue here Angular 12 Editor 2.22.2

editing the node module file to this fixed it for me, not ideal: node_modules@editorjs\editorjs\types\api\tooltip.d.ts

//import {TooltipContent, TooltipOptions} from 'codex-tooltip';
import TooltipOptions from "codex-tooltip"
import TooltipContent from "codex-tooltip"

specifying version of codex-tooltip: 1.0.2 in package.json solves the issue for me on Angular 13.1

const fs = require('fs-extra')

fs.readFile('node_modules/@editorjs/editorjs/types/api/tooltip.d.ts', {
  encoding: 'utf-8',
}).then(brokenFile => {
  const fixedFile = brokenFile.replace(
    `import {TooltipContent, TooltipOptions} from 'codex-tooltip';`,
    `import TooltipOptions from "codex-tooltip"\n
import TooltipContent from "codex-tooltip"`
  )
  console.log(fixedFile)
  fs.writeFile(
    'node_modules/@editorjs/editorjs/types/api/tooltip.d.ts',
    fixedFile,
    { encoding: 'utf-8' }
  )
})

Here’s a fix using fs-extra, not necessary to use fs-extra, just used it for convenience you can rewrite it to regular fs libs, I used this script since it broke before holidays just to be able to use the editor.js, please patch this.

Any update on this? Still find the same error on 2.23.1

codex-tooltip version 1.0.2 will temporarily solve this problem

add this to your package.json

“resolutions”: { “codex-tooltip”: “1.0.2” }

then yarn or npm install

Any update on this? Still find the same error on 2.23.1