Vanessa219 / vditor

♏ 一款浏览器端的 Markdown 编辑器,支持所见即所得(富文本)、即时渲染(类似 Typora)和分屏预览模式。An In-browser Markdown editor, support WYSIWYG (Rich Text), Instant Rendering (Typora-like) and Split View modes.
https://b3log.org/vditor
MIT License
8.25k stars 852 forks source link

Compiled with problems #1584

Closed willzhang closed 5 months ago

willzhang commented 5 months ago

编辑模式

描述问题

参考这个无法运行起来:https://github.com/Vanessa219/vditor?tab=readme-ov-file#%E7%8E%AF%E5%A2%83

git clone https://github.com/Vanessa219/vditor.git -b v3.10.2
cd vditor
npm install
npm run start

# npm -v
10.2.4
root@node1:~/vditor# npm run start

> vditor@3.10.2 start
> webpack serve --config webpack.start.js

<i> [webpack-dev-server] [HPM] Proxy created: /api  -> http://localhost:8080
<i> [webpack-dev-server] [HPM] Proxy rewrite rule created: "^/api" ~> ""
<i> [webpack-dev-server] [HPM] Proxy created: /ld246  -> https://ld246.com
<i> [webpack-dev-server] [HPM] Proxy rewrite rule created: "^/ld246" ~> ""
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:9000/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.72.41:9000/
<i> [webpack-dev-server] Content not from webpack is served from '/root/vditor' directory
<i> [webpack-dev-middleware] wait until bundle finished: /
(node:6736) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method 'reduce' is deprecated)
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:6736) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
(node:6736) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
        Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
        Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
assets by path js/ 18.8 MiB 171 assets
assets by path ../../dist/ 34.1 KiB 109 assets
assets by path images/ 69.6 KiB
  assets by path images/emoji/*.png 52.9 KiB 16 assets
  + 3 assets
assets by path *.js 4.03 MiB
  asset comment.js 1.18 MiB [emitted] (name: comment.js)
  + 3 assets
assets by path ./*.html 19.9 KiB
  asset ./render.html 6.73 KiB [emitted]
  + 3 assets
assets by path css/content-theme/*.css 12.9 KiB
  asset css/content-theme/ant-design.css 4.77 KiB [emitted] [from: src/css/content-theme/ant-design.css] [copied]
  + 3 assets
asset types/index.d.ts 25.5 KiB [emitted] [from: types/index.d.ts] [copied]
runtime modules 110 KiB 52 modules
modules by path ./src/ 610 KiB
  modules by path ./src/ts/ 543 KiB 107 modules
  modules by path ./src/*.ts 22.4 KiB 2 modules
  modules by path ./src/assets/less/*.less 44.5 KiB 2 modules
modules by path ./node_modules/ 296 KiB
  modules by path ./node_modules/webpack-dev-server/client/ 76.3 KiB 16 modules
  modules by path ./node_modules/webpack/hot/*.js 5.21 KiB 4 modules
  modules by path ./node_modules/html-entities/lib/*.js 114 KiB 4 modules
  + 5 modules
modules by path ./demo/*.js 15.1 KiB
  ./demo/index.js 2.89 KiB [built] [code generated]
  ./demo/render.js 2.8 KiB [built] [code generated]
  ./demo/jest-puppeteer.js 4.6 KiB [built] [code generated]
  ./demo/comment.js 4.83 KiB [built] [code generated]

ERROR in /root/vditor/src/ts/undo/index.ts
./src/ts/undo/index.ts
[tsl] ERROR in /root/vditor/src/ts/undo/index.ts(20,33)
      TS2694: Namespace 'diff_match_patch' has no exported member 'diff_match_patch'.
 @ ./src/index.ts 40:0-39 436:31-35
 @ ./demo/index.js 1:0-34 14:22-28

ERROR in /root/vditor/src/ts/undo/index.ts
./src/ts/undo/index.ts
[tsl] ERROR in /root/vditor/src/ts/undo/index.ts(139,36)
      TS7006: Parameter 'patch' implicitly has an 'any' type.
 @ ./src/index.ts 40:0-39 436:31-35
 @ ./demo/index.js 1:0-34 14:22-28

ERROR in /root/vditor/src/ts/undo/index.ts
./src/ts/undo/index.ts
[tsl] ERROR in /root/vditor/src/ts/undo/index.ts(140,38)
      TS7006: Parameter 'diff' implicitly has an 'any' type.
 @ ./src/index.ts 40:0-39 436:31-35
 @ ./demo/index.js 1:0-34 14:22-28

webpack 5.90.3 compiled with 3 errors in 12364 ms

image

期待的结果

显示vditor页面

版本信息

其他信息

Vanessa219 commented 5 months ago

看一下 diff-match-patch 是否安装成功,点击是否可以定位。

image