When vue + ueditor is used, codeMirror and ZeroClipboard report an error unexpected token <

use vue + ueditor as rich text editor
code as follows:
1. Introduce ueditor

2.ueditor

3.ueditor

4.

5.

this is not the case with Baidu. I downloaded the official jsp code copy directly, and I also tried the copy in dist after the complete code grunt. Try in mian.js import ueditor, also try in the component import ueditor, is this kind of error report.
ueditor.config.jswindow.UEDITOR _ HOME_URL is also configured with a path.
urgently ask for a solution!


change it to ueditor.all.js and look for it

 utils.loadFile(document, {
    src: me.options.UEDITOR_HOME_URL + "third-party/zeroclipboard/ZeroClipboard.js",
    tag: "script",
    type: "text/javascript",
    defer: "defer"
    }, function () {
        initZeroClipboard();
    });

do you have this solution? the one I downloaded is php


. Have you solved it? My problem is the same as yours. How to solve it?


has the main problem been solved? Please tell


check whether the UEDITOR_HOME_URL in config is the same as the ueditor file name under static


I am local normal. After packing, I report this error


how to solve this problem, I also encountered the same problem


I just encountered this problem, but it works well in other projects.
I made a comparison. It is a problem with the path configuration that caused the two js files to load unsuccessfully.

in my vue project, in config/index.js,

The configuration in

proxyTable has nothing to do with this case. Mainly look at assetsPublicPath

dev: {

    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/ui/fe/',
    proxyTable: {
        // -sharpConfig
        '/web-api/': {
            target: 'http://127.0.0.1:8001',//
            pathRewrite: {//serverPath
                '^/web-api/': '/web-api/'
            }
        },
    },

then my ueditor.config.js configuration

//assetsPublicPath: '/ui/fe/', config/index.js.
//assetsPublicPath + staticUEditor
window.UEDITOR_HOME_URL = "/ui/fe/static/UEditor/";
var URL = window.UEDITOR_HOME_URL || getUEBasePath();

after ueditor.config.js is configured like this, it works. Some buddies on it say that it is easy to use locally, but not easy to use in production.
maybe the configuration of build in config/index.js is not consistent with that of dev.

build: {
    // Template for index.html
    index: path.resolve(__dirname, '../dist/index.html'),

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/ui/fe/',

    /**
     * Source Maps
     */

above is my solution process to see if it can be helpful to you.


encountered the same problem and tried for a day. Gongshang solution: image.png1.ueditor.config.js image.png

2.vue2 and vue3 are not the same in 2 and will not be processed in static. If it is 3, you may need to put it in the public folder (I can run normally in 2, and the same code has been reported wrong in 3, which is why today's situation has arisen. ) official website ide/html-and-static-assets.html-sharp%E4%B8%8D%E7%94%9F%E6%88%90-index" rel=" nofollow noreferrer "> https://cli.vuejs.org/zh/guid.

Menu