codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.18k stars 2.06k forks source link

Type error, type files are missing while compiling #2771

Closed suhail-ak-s closed 4 weeks ago

suhail-ak-s commented 2 months ago

While installing editorjs in angular 18 version it is showing the type error for importing few files `✘ [ERROR] TS2307: Cannot find module '../../src/components/block' or its corresponding type declarations. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.0/node_modules/@editorjs/editorjs/types/api/blocks.d.ts:1:18:
  1 │ import Block from '../../src/components/block';`

`✘ [ERROR] TS2307: Cannot find module '../../src/components/tools/block' or its corresponding type declarations. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.0/node_modules/@editorjs/editorjs/types/api/tools.d.ts:1:22:
  1 │ import BlockTool from "../../src/components/tools/block";
    ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2307: Cannot find module '../../src/components/utils/popover' or its corresponding type declarations. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.0/node_modules/@editorjs/editorjs/types/configs/index.d.ts:8:14:
  8 │ export * from '../../src/components/utils/popover';
    ╵               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2307: Cannot find module '../src/components/utils/popover' or its corresponding type declarations. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.0/node_modules/@editorjs/editorjs/types/index.d.ts:86:7:
  86 │ } from '../src/components/utils/popover';
     ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2305: Module '"../configs"' has no exported member 'PopoverItemDefaultBaseParams'. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.0/node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:9:
  1 │ import { PopoverItemDefaultBaseParams, PopoverItemHtmlParams, Popov...
    ╵          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2305: Module '"../configs"' has no exported member 'PopoverItemHtmlParams'. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.0/node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:39:
  1 │ ...temDefaultBaseParams, PopoverItemHtmlParams, PopoverItemParams, ...
    ╵                          ~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2305: Module '"../configs"' has no exported member 'PopoverItemParams'. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.0/node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:62:
  1 │ ... PopoverItemHtmlParams, PopoverItemParams, PopoverItemSeparatorP...
    ╵                            ~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2305: Module '"../configs"' has no exported member 'PopoverItemSeparatorParams'. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.0/node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:81:
  1 │ ...PopoverItemParams, PopoverItemSeparatorParams, WithChildren } fr...
    ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2305: Module '"../configs"' has no exported member 'WithChildren'. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.0/node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:109:
  1 │ ...rams, PopoverItemSeparatorParams, WithChildren } from "../configs";
    ╵                                      ~~~~~~~~~~~~

✘ [ERROR] TS2307: Cannot find module '../../src/components/block' or its corresponding type declarations. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.1/node_modules/@editorjs/editorjs/types/api/blocks.d.ts:1:18:
  1 │ import Block from '../../src/components/block';
    ╵                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2307: Cannot find module '../../src/components/tools/block' or its corresponding type declarations. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.1/node_modules/@editorjs/editorjs/types/api/tools.d.ts:1:22:
  1 │ import BlockTool from "../../src/components/tools/block";
    ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2307: Cannot find module '../../src/components/utils/popover' or its corresponding type declarations. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.1/node_modules/@editorjs/editorjs/types/configs/index.d.ts:8:14:
  8 │ export * from '../../src/components/utils/popover';
    ╵               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2307: Cannot find module '../src/components/utils/popover' or its corresponding type declarations. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.1/node_modules/@editorjs/editorjs/types/index.d.ts:86:7:
  86 │ } from '../src/components/utils/popover';
     ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2305: Module '"../configs"' has no exported member 'PopoverItemDefaultBaseParams'. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.1/node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:9:
  1 │ import { PopoverItemDefaultBaseParams, PopoverItemHtmlParams, Popov...
    ╵          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2305: Module '"../configs"' has no exported member 'PopoverItemHtmlParams'. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.1/node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:39:
  1 │ ...temDefaultBaseParams, PopoverItemHtmlParams, PopoverItemParams, ...
    ╵                          ~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2305: Module '"../configs"' has no exported member 'PopoverItemParams'. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.1/node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:62:
  1 │ ... PopoverItemHtmlParams, PopoverItemParams, PopoverItemSeparatorP...
    ╵                            ~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2305: Module '"../configs"' has no exported member 'PopoverItemSeparatorParams'. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.1/node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:81:
  1 │ ...PopoverItemParams, PopoverItemSeparatorParams, WithChildren } fr...
    ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2305: Module '"../configs"' has no exported member 'WithChildren'. [plugin angular-compiler]

node_modules/.pnpm/@editorjs+editorjs@2.30.1/node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:109:
  1 │ ...rams, PopoverItemSeparatorParams, WithChildren } from "../configs";`

Steps to reproduce:

  1. Use angular 18 version
  2. npm i @editorjs/editorjs

Device, Browser, OS: Macbook m3 pro

Editor.js version: 2.30.1

AlbertJohanson commented 1 month ago

How did you solve this i having the same problem

skmainzmn commented 1 month ago

How did you solve this i having the same problem

It looks like a problem with version 2.30.1. Downgrade version to 2.29.1

Kochedykov-Alexander commented 1 month ago

hi! has anyone solved this problem?

neSpecc commented 1 month ago

We're working on the fix. It will be ready in 1-2 days.

Kochedykov-Alexander commented 1 month ago

will you fix it soon?

VladMesesan commented 1 month ago

Do we happen to have any updates on this? Thanks!

nikola-webnauts commented 1 month ago

Hey @neSpecc, we are a bit blocked waiting on the solution. Have you made any progress on this?

VladMesesan commented 3 weeks ago

Error: node_modules/@editorjs/editorjs/types/api/tools.d.ts:1:34 - error TS2307: Cannot find module '@/types/tools/adapters/block-tool-adapter' or its corresponding type declarations.

import { BlockToolAdapter } from '@/types/tools/adapters/block-tool-adapter';

Error: node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:10 - error TS2305: Module '"../configs"' has no exported member 'PopoverItemDefaultBaseParams'.

import { PopoverItemDefaultBaseParams, PopoverItemHtmlParams, PopoverItemParams, PopoverItemSeparatorParams, WithChildren } from "../configs";

Error: node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:40 - error TS2305: Module '"../configs"' has no exported member 'PopoverItemHtmlParams'.

import { PopoverItemDefaultBaseParams, PopoverItemHtmlParams, PopoverItemParams, PopoverItemSeparatorParams, WithChildren } from "../configs";

Error: node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:63 - error TS2305: Module '"../configs"' has no exported member 'PopoverItemParams'.

import { PopoverItemDefaultBaseParams, PopoverItemHtmlParams, PopoverItemParams, PopoverItemSeparatorParams, WithChildren } from "../configs";

Error: node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:82 - error TS2305: Module '"../configs"' has no exported member 'PopoverItemSeparatorParams'.

import { PopoverItemDefaultBaseParams, PopoverItemHtmlParams, PopoverItemParams, PopoverItemSeparatorParams, WithChildren } from "../configs";

Error: node_modules/@editorjs/editorjs/types/tools/menu-config.d.ts:1:110 - error TS2305: Module '"../configs"' has no exported member 'WithChildren'.

import { PopoverItemDefaultBaseParams, PopoverItemHtmlParams, PopoverItemParams, PopoverItemSeparatorParams, WithChildren } from "../configs";

Issue still persists even after update. All other packages are up to date.

EDIT:

menu-config.d.ts needs to have imports as: import { PopoverItemDefaultBaseParams, WithChildren, PopoverItemSeparatorParams, PopoverItemHtmlParams } from "@editorjs/editorjs/types/utils/popover"; This solves this issue.

tools.d.ts BlockToolAdapter can't find module from: import { BlockToolAdapter } from '@/types/tools/adapters/block-tool-adapter'; Not sure how to solve this though. Can't find the BlockToolAdapter at all.

These are the leftover issues.

VladMesesan commented 3 weeks ago

Build also throws warnings related to editorJS:

Warning:
C:/Company/Angular/ClientWeb/ClientApp/node_modules/@editorjs/editorjs/types/configs/conversion-config.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: 
C:/Company/Angular/ClientWeb/ClientApp/node_modules/@editorjs/editorjs/types/data-formats/block-id.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: 
C:/Company/Angular/ClientWeb/ClientApp/node_modules/@editorjs/editorjs/types/events/block/Base.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: 
C:/Company/Angular/ClientWeb/ClientApp/node_modules/@editorjs/editorjs/types/events/block/BlockAdded.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: 
C:/Company/Angular/ClientWeb/ClientApp/node_modules/@editorjs/editorjs/types/events/block/BlockChanged.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: 
C:/Company/Angular/ClientWeb/ClientApp/node_modules/@editorjs/editorjs/types/events/block/BlockMoved.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: 
C:/Company/Angular/ClientWeb/ClientApp/node_modules/@editorjs/editorjs/types/events/block/BlockRemoved.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: 
C:/Company/Angular/ClientWeb/ClientApp/node_modules/@editorjs/editorjs/types/events/block/index.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: 
C:/Company/Angular/ClientWeb/ClientApp/node_modules/@editorjs/editorjs/types/utils/popover/popover-event.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: 
C:/Company/Angular/ClientWeb/ClientApp/node_modules/@editorjs/editorjs/types/utils/popover/popover-item-type.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.