question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Error: node_modules/ngx-editor/lib/commands/Heading.d.ts:2:10 - error TS2305: Module '"prosemirror-commands"' has no exported member 'type'.

See original GitHub issue

What happened?

On ng build, we are facing the error Module ‘“prosemirror-commands”’ has no exported member ‘type’. import { type Command } from ‘prosemirror-commands’;

Version

v12.4.1

Angular Version

v12.2.5

What browsers are you seeing the problem on?

No response

Link to reproduce

No response

Relevant log output

Error: node_modules/ngx-editor/lib/commands/Heading.d.ts:2:10 - error TS2305: Module '"prosemirror-commands"' has no exported member 'type'.

2 import { type Command } from 'prosemirror-commands';
           ~~~~


Error: node_modules/ngx-editor/lib/commands/Heading.d.ts:2:15 - error TS1005: ',' expected.

2 import { type Command } from 'prosemirror-commands';
                ~~~~~~~


Error: node_modules/ngx-editor/lib/commands/Heading.d.ts:2:15 - error TS2459: Module '"prosemirror-commands"' declares 'Command' locally, but it is not exported.

2 import { type Command } from 'prosemirror-commands';
                ~~~~~~~

  node_modules/prosemirror-commands/dist/index.d.ts:2:10
    2 import { Command } from 'prosemirror-state';
               ~~~~~~~
    'Command' is declared here.


Error: node_modules/ngx-editor/lib/commands/Image.d.ts:1:10 - error TS2305: Module '"prosemirror-state"' has no exported member 'type'.

1 import { type EditorState } from 'prosemirror-state';
           ~~~~


Error: node_modules/ngx-editor/lib/commands/Image.d.ts:1:15 - error TS1005: ',' expected.

1 import { type EditorState } from 'prosemirror-state';
                ~~~~~~~~~~~


Error: node_modules/ngx-editor/lib/commands/Image.d.ts:2:15 - error TS2459: Module '"prosemirror-commands"' declares 'Command' locally, but it is not exported.

2 import type { Command } from 'prosemirror-commands';
                ~~~~~~~

  node_modules/prosemirror-commands/dist/index.d.ts:2:10
    2 import { Command } from 'prosemirror-state';
               ~~~~~~~
    'Command' is declared here.


Error: node_modules/ngx-editor/lib/commands/Link.d.ts:2:10 - error TS2305: Module '"prosemirror-commands"' has no exported member 'type'.

2 import { type Command } from 'prosemirror-commands';
           ~~~~


Error: node_modules/ngx-editor/lib/commands/Link.d.ts:2:15 - error TS1005: ',' expected.

2 import { type Command } from 'prosemirror-commands';
                ~~~~~~~


Error: node_modules/ngx-editor/lib/commands/Link.d.ts:2:15 - error TS2459: Module '"prosemirror-commands"' declares 'Command' locally, but it is not exported.

2 import { type Command } from 'prosemirror-commands';
                ~~~~~~~

  node_modules/prosemirror-commands/dist/index.d.ts:2:10
    2 import { Command } from 'prosemirror-state';
               ~~~~~~~
    'Command' is declared here.


Error: node_modules/ngx-editor/lib/commands/TextAlign.d.ts:2:15 - error TS2459: Module '"prosemirror-commands"' declares 'Command' locally, but it is not exported.

2 import type { Command } from 'prosemirror-commands';
                ~~~~~~~

  node_modules/prosemirror-commands/dist/index.d.ts:2:10
    2 import { Command } from 'prosemirror-state';
               ~~~~~~~
    'Command' is declared here.


Error: node_modules/ngx-editor/lib/commands/types.d.ts:2:10 - error TS2459: Module '"prosemirror-commands"' declares 'Command' locally, but it is not exported.

2 import { Command } from 'prosemirror-commands';
           ~~~~~~~

  node_modules/prosemirror-commands/dist/index.d.ts:2:10
    2 import { Command } from 'prosemirror-state';
               ~~~~~~~
    'Command' is declared here.


Error: node_modules/ngx-editor/lib/defaultPlugins.d.ts:11:90 - error TS2707: Generic type 'Plugin<PluginState>' requires between 0 and 1 type arguments.

11 export declare const getKeyboardShortcuts: (schema: Schema, options: ShortcutOptions) => Plugin<any, any>[];
                                                                                            ~~~~~~~~~~~~~~~~


Error: node_modules/ngx-editor/schema/index.d.ts:2:230m - error TS2315: Type 'Schema' is not generic.

2 declare const schema: Schema<"blockquote" | "image" | "text" | "ordered_list" | "bullet_list" | "list_item" | "doc" | "paragraph" | "horizontal_rule" | "heading" | "hard_break" | "code_block", "link" | "code" | "em" | "s" | "strong" | "u" | "text_color" | "text_background_color">;
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/ngx-editor/schema/nodes.d.ts:30:24 - error TS2315: Type 'Node' is not generic.

30         toDOM?: (node: ProseMirrorNode<any>) => DOMOutputSpec;
                          ~~~~~~~~~~~~~~~~~~~~


Error: node_modules/ngx-editor/schema/nodes.d.ts:32:32 - error TS2315: Type 'Node' is not generic.

32         toDebugString?: (node: ProseMirrorNode<any>) => string;
                                  ~~~~~~~~~~~~~~~~~~~~


Error: node_modules/ngx-editor/schema/nodes.d.ts:51:24 - error TS2315: Type 'Node' is not generic.

51         toDOM?: (node: ProseMirrorNode<any>) => DOMOutputSpec;
                          ~~~~~~~~~~~~~~~~~~~~


Error: node_modules/ngx-editor/schema/nodes.d.ts:53:32 - error TS2315: Type 'Node' is not generic.

53         toDebugString?: (node: ProseMirrorNode<any>) => string;
                                  ~~~~~~~~~~~~~~~~~~~~


Error: node_modules/ngx-editor/schema/nodes.d.ts:72:24 - error TS2315: Type 'Node' is not generic.

72         toDOM?: (node: ProseMirrorNode<any>) => DOMOutputSpec;
                          ~~~~~~~~~~~~~~~~~~~~


Error: node_modules/ngx-editor/schema/nodes.d.ts:74:32 - error TS2315: Type 'Node' is not generic.

74         toDebugString?: (node: ProseMirrorNode<any>) => string;
                                  ~~~~~~~~~~~~~~~~~~~~


Error: node_modules/prosemirror-model/dist/index.d.ts:1:8 - error TS1259: Module '"C:/Workspace/Temp/12.2.5/test/node_modules/@types/orderedmap/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag

1 import OrderedMap from 'orderedmap';
         ~~~~~~~~~~

  node_modules/@types/orderedmap/index.d.ts:7:1
    7 export = OrderedMap;
      ~~~~~~~~~~~~~~~~~~~~
    This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.

Willing to submit a PR?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:44 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
sibiraj-scommented, Jun 1, 2022

Thanks. prose-mirror seems to now have types of their own as they ported to typescript and hence definitely typed packages are not considered. and Command seems to be exported from prosemirror-state now. They should have released in a major. Let me fix this or pin the versions to an older version where it still works.

2reactions
prajyot-totecommented, Jun 1, 2022

Yes. issue is with typescript : 4.4.4. Upgrading sorts the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

3.54.1 generates error TS2305 "@aws-sdk/types" has ... - GitHub
Describe the bug Running tsc on a project with the default ... 3.54.1 generates error TS2305 "@aws-sdk/types" has no exported member ...
Read more >
has no exported member when importing a function
But here I get the error: TS2305: Module has no exported member 'func1'. and same for func2. What am I missing?
Read more >
Module '"@prismicio/client"' has no exported member 'Content'
As title states, I'm getting this error: This is my prismic.ts: import * as prismic from '@prismicio/client'; import * as prismicNext from ...
Read more >
Typescript errors when using @polkadot/api
I'm building a typescript project and I'm trying to do the very simplest thing as a first step with Polkadot: Connect to a...
Read more >
Angular Material “has no exported member 'MaterialModule'”
Regarding the first problem, a simple fix is to create your own material module as below, import { NgModule } from '@angular/core';import {...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found