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

这篇具有很好参考价值的文章主要介绍了引入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 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文件

引入wangeditor 报错 error in ./node_modules/@wangeditor/editor/dist/index.esm.js,javascript,前端,开发语言

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

 引入wangeditor 报错 error in ./node_modules/@wangeditor/editor/dist/index.esm.js,javascript,前端,开发语言

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

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

引入wangeditor 报错 error in ./node_modules/@wangeditor/editor/dist/index.esm.js,javascript,前端,开发语言文章来源地址https://www.toymoban.com/news/detail-680381.html

到了这里,关于引入wangeditor 报错 error in ./node_modules/@wangeditor/editor/dist/index.esm.js的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 解决ERROR in ./node_modules/vuex/dist/vuex.esm.js

    当你安装vuex时,安装完成后可能会出现这样的报错 ERROR in ./node_modules/vuex/dist/vuex.esm.js    两种原因: 1、如果你是用的是vue2,那应该安装vuex@3版本 npm i vuex@3 如果你是用的是vue3,那么应该安装vuex@4版本  npm i vuex@4 2、第二种情况就是,你安装的版本没问题,但是你是在运行情

    2024年02月16日
    浏览(36)
  • vue报错:in ../node_modules/axios/lib/platform/index.js

    报错信息截图: 报错原因: 第三方组件版本冲突,一般下载axios默认下载的是最新版本1.6.2,而我们只需要将axios的版本改为1.5.0即可 解决办法: 1-打开项目的文件夹“node_modules” 2-删除里面的文件夹“axios” 3-在“package.json”中,将axios的版本信息改为1.5.0 4-在终端输入命令

    2024年03月10日
    浏览(48)
  • 报错记录:can‘t resolve ‘fs‘ in node_modules,Vue3

     报错详情 : 报错原因 :手欠把body-parser安到前端了 解决方法 :把body-parser删了就行了 另外进行了以下错误尝试: 找资料发现vue2出现这种情况,需要得webpack.config.js里新增 在vue3中,没有webpack.config.js,就在vue.config.js里加 resolve: { fallback: { fs: false } },配置后终端也是不报错

    2024年02月13日
    浏览(37)
  • 【Error】This relative module was not found:* ./dataAsset in ./node_modules/cache-loader/dist/cjs.js

     报错信息: This relative module was not found: * ./dataAsset in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules /vue-loader/lib??vue-loader-options!./src/views/index.vue?vuetype=scriptlang=js 相对应的模块没找到 dataAsset.vue 这个组件没找到

    2024年02月04日
    浏览(30)
  • Vue项目遇到的报错:Module Error (from ./node_modules/eslint-loader/index.js)

    在运行创建的项目时出现的报错问题 Module Error (from ./node_modules/eslint-loader/index.js);具体报错如下图显示; 此问题在有时项目运行时不会报错,有时会报错; 找到根目录,在根目录下创建文件 vue.config.js 在创建的项目文件内输入 保存,重新运行便可。 初始化并重新安装 esl

    2024年02月06日
    浏览(43)
  • Install fail! Error: run install error, please remove node_modules before retry!解决这个报错

     Install fail! Error: run install error, please remove node_modules before retry! Command failed with exit code 1: node install.js Error: Command failed with exit code 1: node install.js     at makeError (C:UsersAdministratorAppDataRoamingnpmnode_modulescnpmnode_modulesexecaliberror.js:60:11)     at handlePromise (C:UsersAdministratorAppDa

    2024年02月09日
    浏览(36)
  • 使用vue-qr,报错in ./node_modules/vue-qr/dist/vue-qr.js

    找到node_modules— vue-qr/dist/vue-qr.js 文件,搜…e,将…去掉,然后重新运行项目。

    2024年02月03日
    浏览(31)
  • 打包报错Error: ‘default‘ is not exported by node_modules/qs/lib/index.js

    问题描述: 当我们在使用rollup编译es6时,可能会遇到以下报错问题 解决方案: 安装@rollup/plugin-commonjs插件   最后,修改rollup.config.js文件中写入以下代码即可

    2024年02月16日
    浏览(37)
  • 微信小程序引入node_modules依赖

    微信小程序不支持直接读取node_modules 首先在目录文件夹下cmd输入npm init命令 以上为cmd下操作过程,基本一路enter即可。 最后removed 181 packages in 2m是应为之前在calendar_1下就有node_modules。 然后到微信开发者工具下: 构建完成: 会生成如下文件夹:

    2024年02月03日
    浏览(28)
  • 【解决】运行vue项目,启动报错 in ./node_modules/@intlify/core-base/dist/core-base.cjs

    我的处理方式: 一开始查了好多方法,删除node_modules,重新安装,切换node版本等,但是发现并没有用 之后来发现是安装依赖包的时候有些包安装失败导致的,只要有针对性的重新安装依赖就可以了 例如: in ./node_modules/@intlify/ core-base /dist/core-base.cjs 如果在项目启动的时候遇到

    2024年02月08日
    浏览(32)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包