Open SinLiz opened 4 years ago
Could you provide the text your pasted?
Everything was normal before. Later, after I updated the version of element-tiptap to 1.26.1, there was no response when I clicked on the picture to upload; I deleted the node_modules folder and re-used yarn to update the dependencies and the following problems occurred:
error in ./node_modules/tiptap/dist/tiptap.esm.js
Module parse failed: Unexpected token (126:23)
You may need an appropriate loader to handle this file type.
| } = this.node;
| const pos = this.getPos();
| const newAttrs = { ...this.node.attrs,
| ...attrs
| };
@ ./node_modules/element-tiptap/lib/element-tiptap.esm.js 1:19-170 1:170-195
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server babel-polyfill ./src/main.js
error in ./node_modules/tiptap-extensions/dist/extensions.esm.js
Module parse failed: Unexpected token (176:15)
You may need an appropriate loader to handle this file type.
| const to = from + node.text.length;
| startPos = to;
| return { ...node,
| from,
| to
@ ./node_modules/element-tiptap/lib/element-tiptap.esm.js 1:195-476 1:476-566
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server babel-polyfill ./src/main.js
I found after investigation: my tiptap version is 1.29.6, I modified it to 1.29.1 version, everything is normal. I set tiptap: "^1.29.1" in package.json to no effect, I always download version 1.29.6. Hey, I am not very familiar with these, I hope you can help me see how to deal with this problem.
This issue may help you https://github.com/babel/babel-loader/issues/370
error in ./node_modules/tiptap/dist/tiptap.esm.js
Module parse failed: Unexpected token (126:23) You may need an appropriate loader to handle this file type. | } = this.node; | const pos = this.getPos(); | const newAttrs = { ...this.node.attrs, | ...attrs | };
@ ./node_modules/element-tiptap/lib/element-tiptap.esm.js 1:19-170 1:170-195 @ ./src/main.js @ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server babel-polyfill ./src/main.js
error in ./node_modules/tiptap-extensions/dist/extensions.esm.js
Module parse failed: Unexpected token (176:15) You may need an appropriate loader to handle this file type. | const to = from + node.text.length; | startPos = to; | return { ...node, | from, | to
@ ./node_modules/element-tiptap/lib/element-tiptap.esm.js 1:195-476 1:476-566 @ ./src/main.js @ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server babel-polyfill ./src/main.js
how to resolve it
In order to solve the problem of copying and pasting from "html/doc/docx" to the editor, custom “extensions” were selected, but the Image() became invalid, there was no error in the console, and no response was clicked. What caused it? Here are my “extensions":
extensions: [ new Doc(), new Text(), new Paragraph(), new Heading({ level: 5 }), new Bold(), new LineHeight(), new TextColor(), new TextAlign(), new Indent(), new History(), new Blockquote(), new FormatClear(), new Link(), new Image({ uploadRequest: (file) => { return this.imageUpload(file) } }), new Iframe(), new Appendix({ refId: this.refId, refType: this.refType }), new Table({ resizable: true }), new TableHeader(), new TableCell(), new TableRow(), new HorizontalRule(), new TrailingNode(), new SelectAll(), new CodeView({ codemirror, codemirrorOptions: { styleActiveLine: true, autoCloseTags: true } }), new Print(), new Preview(), new Fullscreen() ]