uiwjs / react-md-editor

A simple markdown editor with preview, implemented with React.js and TypeScript.
https://uiwjs.github.io/react-md-editor
MIT License
2.17k stars 156 forks source link

引入项目中,编译失败 #172

Closed kimmy-wang closed 3 years ago

kimmy-wang commented 3 years ago

node_modules/@uiw/react-md-editor/lib/cjs/index.d.ts:4:1 - error TS1128: Declaration or statement expected.

4 export type { ICommand, CommandOrchestrator, TextRange, TextState, TextApi } from './commands';
  ~~~~~~

node_modules/@uiw/react-md-editor/lib/cjs/index.d.ts:4:13 - error TS1005: ';' expected.

4 export type { ICommand, CommandOrchestrator, TextRange, TextState, TextApi } from './commands';
              ~

node_modules/@uiw/react-md-editor/lib/cjs/index.d.ts:4:83 - error TS1005: ';' expected.

4 export type { ICommand, CommandOrchestrator, TextRange, TextState, TextApi } from './commands';
                                                                                    ~~~~~~~~~~~~

node_modules/@uiw/react-md-editor/lib/cjs/index.d.ts:5:1 - error TS1128: Declaration or statement expected.

5 export type { TextSection } from './utils/markdownUtils';
  ~~~~~~

node_modules/@uiw/react-md-editor/lib/cjs/index.d.ts:5:13 - error TS1005: ';' expected.

5 export type { TextSection } from './utils/markdownUtils';
              ~

node_modules/@uiw/react-md-editor/lib/cjs/index.d.ts:5:34 - error TS1005: ';' expected.

5 export type { TextSection } from './utils/markdownUtils';
                                   ~~~~~~~~~~~~~~~~~~~~~~~

Found 6 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! topbi@1.26.0 tsc: `tsc "-p" "src/server/tsconfig.json"`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the topbi@1.26.0 tsc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
jaywcjlove commented 3 years ago

@realkimmy 不清楚你的工程,不知道怎么解决。

kimmy-wang commented 3 years ago

@realkimmy 不清楚你的工程,不知道怎么解决。

index.tsx,改成这样就好了

import MDEditor from './Editor';
import * as commands from './commands';
import * as MarkdownUtil from './utils/markdownUtils';

export * from './commands';
export * from './utils/markdownUtils';

export * from './Editor';

export { MarkdownUtil, commands };

export default MDEditor;
jaywcjlove commented 3 years ago

@realkimmy Upgrade + @uiw/react-md-editor@3.0.10