引入wangeditor 报错 error in ./node_modules/@wangeditor/editor/dist/index.esm.js

2023-11-03

 ERROR  Failed to compile with 1 errors                                                                                                       17:53:12

 error  in ./node_modules/@wangeditor/editor/dist/index.esm.js

Module parse failed: Unexpected token (18:966)
You may need an appropriate loader to handle this file type.
|  * @param {object} options with values that will be used to replace placeholders
|  * @returns {any[]} interpolated
|  */function ry(e,t){const n=/\$/g;let r=[e];if(null==t)return r;for(const e of Object.keys(t))if("_"!==e){let o=t[e];"string"==typeof o&&(o=n[Symbol.replace](o,"$$$$")),r=ny(r,new RegExp(`%\\{${e}\\}`,"g"),o)}return r}var oy=(Xv=ty("apply"),class{constructor(e){Object.defineProperty(this,Xv,{value:iy}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(Qv(this,Xv)[Xv],this):Qv(this,Xv)[Xv](e)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return ry(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return ry(n,t)}});function iy(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}var ay=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,o,i,a,u){var s=function(e){var n=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(t),a=0,u=i.length;for(;a<u;a++){var s=i[a];if("*"===s&&(n=n.concat(t[s])),2===o.length&&o[0]===s){n=n.concat(t[s]);break}}return n}(e);s.length&&function(e,t,n){var r=0,o=t.length;for(;r<o&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,s,[n,r,o,i,a,u])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,(function r(){n.apply(this,arguments),e.off(t,r)}))},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],o=0,i=r?r.length:0;o<i;o++)r[o]!==t&&n.push(r[o]);n.length?this._fns[e]=n:delete this._fns[e]},e};var uy={urlAlphabet:"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"};let{urlAlphabet:sy}=uy,ly=e=>crypto.getRandomValues(new Uint8Array(e)),cy=(e,t,n)=>{let r=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*r*t/e.length);return()=>{let i="";for(;;){let a=n(o),u=o;for(;u--;)if(i+=e[a[u]&r]||"",i.length===t)return i}}};var fy={nanoid:(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t},customAlphabet:(e,t)=>cy(e,t,ly),customRandom:cy,urlAlphabet:sy,random:ly},dy=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,r));var o=n[r];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+o:(t?"-":"")+e.toFixed(1)+" "+o};function py(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}py.prototype.match=function(e){var t,n,r=!0,o=this.parts,i=o.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;r&&t<i;t++)"*"!==o[t]&&(r=t<n.length&&o[t]===n[t]);r=r&&n}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var a in r={},e)this.match(a)&&(r[a]=e[a]);return r};var hy=/[\/\+\.]/,gy=function(e,t){function n(t){var n=function(e,t,n){var r=new py(e,n||/[\/\.]/);return void 0!==t?r.match(t):r}(t,e,hy);return n&&n.length>=2}return t?n(t.split(";")[0]):n};var vy=0;function yy(e){return"__private_"+vy+++"_"+e}var my=yy("publish");class by{constructor(){Object.defineProperty(this,my,{value:wy}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},n={...this.state,...e};this.state=n,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,my)[my](t,n,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function wy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach((e=>{e(...t)}))}by.VERSION="2.0.3";var Ey=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}},Dy={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"

 解决办法

找到自己项目中的webpack.base.conf.js文件

 找到下图中的代码下方,插入一块代码就解决了

 

   {
        test: /\.js$/,
        loader: 'babel-loader',
        include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client'),resolve('node_modules/@wangeditor')
        ]
      },

 最后完整代码,改完记得重启

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

引入wangeditor 报错 error in ./node_modules/@wangeditor/editor/dist/index.esm.js 的相关文章

随机推荐

  • attachInterrupt()函数

    attachInterrupt 函数介绍 attachInterrupt 函数是用于为Arduino开发板设置和执行ISR 中断服务程序 用的 ISR 中断服务程序 顾名思义就是中断Arduino当前正在处理的事情而优先去执行中断服务程序
  • 【CF补题】Codeforces Round #784 (Div. 4)C++代码

    A include
  • idea连接kerberos认证的hive

    其实用dbeaver连接hive就可以了 但是呢 idea也有这个功能 本着研究下的想法就试试 结果最后成功了 最后记录下 参考文章 感觉不太行 PyCharm idea通过插件database连接带Kerberos的hive 不饿同学的博
  • 服装商品销售数据分析

    一 分析背景和数据来源 随着电商的快速发展 人们的购物行为占比也快速增加 作为电商卖家为了获取更多的用户并提升店铺销售量 可以结合产品销售情况和用户情况进行分析 得到有价值的信息 规划自己的销售策略 本文以淘宝天猫上服装商品购买情况数据为例
  • Qt绘制雷达图(卫星轨迹图)

    效果图 功能 使用QPainter绘制 雷达图主要包括 同心圆 十字架 刻度 不同颜色的圆圈 可以设置卫星的俯仰角 方位角 程序采用系统与卫星的结合 多种系统 n个卫星数据 进行显示 可自行搭配数据结构 监测卫星活动状态 定时清理无数据卫星
  • 数值概率算法

    基本概念 计算定积分 rand和srand 在解决设计问题时 有时会用到概率算法 概率算法允许在执行过程中随机的选择下一步的计算步骤 又是可使算法大大降低复杂度 提高算法效率 但有时也可能得不到问题的全部答案 基本概念 概率算法大致分为4类
  • 【Python】list.append()字典在for循环中数据覆盖的分析与解决

    问题 预期打印出来的list为 num 0 num 1 num 2 结果为 num 2 num 2 num 2 list dictionary num for i in range 3 dictionary num i list appen
  • 安装bootstrap

    导入软件源的 GPG key 并且添加 Yarn APT 软件源到你的系统 curl sS https dl yarnpkg com debian pubkey gpg sudo apt key add echo deb https dl
  • USB

    usb有主从设备之分 主设备有 pc 现在市面上的那些插u disk即可播放mp3的 mp3 之类的 usb 信号是差分信号 信号线为D D 在usb host 端 D D 各接一个15kohm 的下拉电阻 而在usb device端 这时
  • ue打开服务器文件速度很慢,看完大牛这篇文章,再遇到服务器反映慢的情况就不怕了...

    最近服务器反映很慢 查看服务器上的应用程序经常出现超时等等 而且还有时候出现卡死的情况 经过发现服务器I O压力很大 压力来自硬盘的I O访问已经达到100 最后原因是线上业务代码同一时间写入导致服务器硬盘I O爆表了 我这里纪录一下为了方
  • Hadoop集群搭建记录

    本文目录 写在前面 step1 安装openssh server step2 ssh文件夹的创建及生成密钥文件 step3 传送该文件 step4 slave1 slave2节点操作 step5 所有节点最终配置 免密登录成功 写在前面 本
  • 原来早就有java代码规范

    happy 最近几天 研究代码规范 想给给公司制定一个代码规范 公司很小 目前还没有代码规范 这个东西很烦人 也很难产生作用 小公司一般不采用吧 但现在为了提高代码质量 也就需要考虑了 今天 发现早在1997年 SUN公司就制定了java代
  • logit回归模型_混合logit模型(随机参数模型)的STATA应用及结果解读

    选择实验获得的数据主要通过离散选择模型来完成 离散选择模型中 最主要的是logit模型 之前已经介绍了二项logit模型回归的STATA实现 有修改 多项logit模型详解 多项logit模型回归系数解读 多项logit模型回归的检验 继续
  • spring boot AOP练习 @Aspect

    spring boot AOP练习 Aspect 环境
  • 【测评】用这款神器2小时就撸完了1天工作量的代码!爽

    目 录 一 写在前面 二 测评信息 三 测评体验 3 1 安装方便 3 2 始于颜值 3 2 1 简约美观的主题 3 2 2 多变时尚的风格 3 3 忠于强大 3 3 1 快捷的搜索 3 3 2 丰富的功能 3 3 3 开发者神器 3 4
  • [LeetCode] 811. 子域名访问计数

    题目描述 一个网站域名 如 discuss leetcode com 包含了多个子域名 作为顶级域名 常用的有 com 下一级则有 leetcode com 最低的一级为 discuss leetcode com 当我们访问域名 discu
  • python android 录制屏幕

    def settingtime while True starttime time strftime H M S recordcmd adb shell screenrecord sdcard demo mp4 pullfile adb p
  • 开发者的时代红利在哪里?

    2021 年和 2022 年 也许给很多人上了一场关于 风险意识教育 的课程 无论你是 最难 毕业季中的应届毕业生 还是在职场中苦寻事业道路的各行从业者 这一课众生平等 在疫情影响之下 经济大环境动荡 要想在市场下行的背景下全身而退 就需要
  • c++拷贝构造函数(深拷贝,浅拷贝)详解

    一 什么是拷贝构造函数 首先对于普通类型的对象来说 它们之间的复制是很简单的 例如 int a 100 int b a 而类对象与普通对象不同 类对象内部结构一般较为复杂 存在各种成员变量 下面看一个类对象拷贝的简单例子 include
  • 引入wangeditor 报错 error in ./node_modules/@wangeditor/editor/dist/index.esm.js

    ERROR Failed to compile with 1 errors 17 53 12 error in node modules wangeditor editor dist index esm js Module parse fa