editablejs / editable

🌱 A collaborative rich-text editor framework that focuses on stability, controllability, extensibility, and performance. 一款强到离谱的富文本编辑器框架,专注于稳定性、可控性、扩展性和性能。
https://docs.editablejs.com
Apache License 2.0
1.8k stars 121 forks source link

插件安装都时候报了一些错误 #111

Open xiezhenqun opened 1 year ago

xiezhenqun commented 1 year ago

Failed to compile with 2 errors 10:15:21 PM

error in ./node_modules/.pnpm/registry.npmmirror.com+@editablejs+models@1.0.0/node_modules/@editablejs/models/dist/index.js

Module parse failed: Unexpected token (167:62) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | at = entry; | }

const { start, end } = Grid.edges(editor, at, selection) ?? { start: [0, 0], end: [-1, -1] };

| const [startRow, startCol] = start; | const [endRow, endCol] = end;

@ ./src/pages/index.tsx 11:0-50 19:48-60 @ ./src/.umi/core/routes.ts @ ./src/.umi/umi.ts @ multi ./node_modules/.pnpm/registry.npmmirror.com+@umijs+preset-built-in@3.5.37_wcqkhtmu7mswc6yz4uyexck3ty/node_modules/@umijs/preset-built-in/bundled/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js ./src/.umi/umi.ts

error in ./node_modules/.pnpm/registry.npmmirror.com+@editablejs+editor@1.0.1_vpscx6nkgaztuarbps7cjhyz2e/node_modules/@editablejs/editor/dist/index.js

Module parse failed: Unexpected token (180:25) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | var matchFragmentStringFromHTML = (html) => { | const reg = new RegExp(${DATA_EDITABLE_FRAGMENT}="(.+?)");

return html.match(reg)?.[1] ?? ""; | }; | var parseDataTransferFiles = (dataTransfer) => {

@ ./src/pages/index.tsx 12:0-85 19:35-47 20:30-46 22:35-50 @ ./src/.umi/core/routes.ts @ ./src/.umi/umi.ts @ multi ./node_modules/.pnpm/registry.npmmirror.com+@umijs+preset-built-in@3.5.37_wcqkhtmu7mswc6yz4uyexck3ty/node_modules/@umijs/preset-built-in/bundled/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js ./src/.umi/umi.ts

ERROR in ./node_modules/.pnpm/registry.npmmirror.com+@editablejs+models@1.0.0/node_modules/@editablejs/models/dist/index.js 167:62 Module parse failed: Unexpected token (167:62) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | at = entry; | }

const { start, end } = Grid.edges(editor, at, selection) ?? { start: [0, 0], end: [-1, -1] };

| const [startRow, startCol] = start; | const [endRow, endCol] = end; @ ./src/pages/index.tsx 11:0-50 19:48-60 @ ./src/.umi/core/routes.ts @ ./src/.umi/umi.ts @ multi ./node_modules/.pnpm/registry.npmmirror.com+@umijs+preset-built-in@3.5.37_wcqkhtmu7mswc6yz4uyexck3ty/node_modules/@umijs/preset-built-in/bundled/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js ./src/.umi/umi.ts

ERROR in ./node_modules/.pnpm/registry.npmmirror.com+@editablejs+editor@1.0.1_vpscx6nkgaztuarbps7cjhyz2e/node_modules/@editablejs/editor/dist/index.js 180:25 Module parse failed: Unexpected token (180:25) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | var matchFragmentStringFromHTML = (html) => { | const reg = new RegExp(${DATA_EDITABLE_FRAGMENT}="(.+?)");

return html.match(reg)?.[1] ?? ""; | }; | var parseDataTransferFiles = (dataTransfer) => { @ ./src/pages/index.tsx 12:0-85 19:35-47 20:30-46 22:35-50 @ ./src/.umi/core/routes.ts @ ./src/.umi/umi.ts @ multi ./node_modules/.pnpm/registry.npmmirror.com+@umijs+preset-built-in@3.5.37_wcqkhtmu7mswc6yz4uyexck3ty/node_modules/@umijs/preset-built-in/bundled/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js ./src/.umi/umi.ts

xiezhenqun commented 1 year ago

怎么以插件的形式引进来工程中呢?

big-camel commented 1 year ago

能否在 https://codesandbox.io/ 上给个复现?