Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ReferenceError: document is not defined

摘要:
Modulebuildfailed(来自./node_modules/mini-css extract-plugin/dist/loader.js):webestode_modulesstylus loaderindex.js:18)atmodule.exports.module.exports(E:E;webestode-modulesscss-loaderlistcjs.js;
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ReferenceError: document is not defined
    at insertStyleElement (E:webs	est
ode_modulesstyle-loaderdistcjs.js!E:webs	est
ode_modulescss-loaderdistcjs.js!E:webs	est
ode_modulespostcss-loadersrcindex.js??ref--4-3!E:webs	est
ode_modulesstylus-loaderindex.js!E:webs	estclientassetsstylesfooter.styl:309:15)
    at addStyle (E:webs	est
ode_modulesstyle-loaderdistcjs.js!E:webs	est
ode_modulescss-loaderdistcjs.js!E:webs	est
ode_modulespostcss-loadersrcindex.js??ref--4-3!E:webs	est
ode_modulesstylus-loaderindex.js!E:webs	estclientassetsstylesfooter.styl:424:13)
    at modulesToDom (E:webs	est
ode_modulesstyle-loaderdistcjs.js!E:webs	est
ode_modulescss-loaderdistcjs.js!E:webs	est
ode_modulespostcss-loadersrcindex.js??ref--4-3!E:webs	est
ode_modulesstylus-loaderindex.js!E:webs	estclientassetsstylesfooter.styl:297:18)
    at module.exports.module.exports (E:webs	est
ode_modulesstyle-loaderdistcjs.js!E:webs	est
ode_modulescss-loaderdistcjs.js!E:webs	est
ode_modulespostcss-loadersrcindex.js??ref--4-3!E:webs	est
ode_modulesstylus-loaderindex.js!E:webs	estclientassetsstylesfooter.styl:455:25)
    at Object.<anonymous> (E:webs	est
ode_modulesstyle-loaderdistcjs.js!E:webs	est
ode_modulescss-loaderdistcjs.js!E:webs	est
ode_modulespostcss-loadersrcindex.js??ref--4-3!E:webs	est
ode_modulesstylus-loaderindex.js!E:webs	estclientassetsstylesfooter.styl:206:14)
    at __webpack_require__ (E:webs	est
ode_modulesstyle-loaderdistcjs.js!E:webs	est
ode_modulescss-loaderdistcjs.js!E:webs	est
ode_modulespostcss-loadersrcindex.js??ref--4-3!E:webs	est
ode_modulesstylus-loaderindex.js!E:webs	estclientassetsstylesfooter.styl:21:30)
    at E:webs	est
ode_modulesstyle-loaderdistcjs.js!E:webs	est
ode_modulescss-loaderdistcjs.js!E:webs	est
ode_modulespostcss-loadersrcindex.js??ref--4-3!E:webs	est
ode_modulesstylus-loaderindex.js!E:webs	estclientassetsstylesfooter.styl:85:18
    at Object.<anonymous> (E:webs	est
ode_modulesstyle-loaderdistcjs.js!E:webs	est
ode_modulescss-loaderdistcjs.js!E:webs	est
ode_modulespostcss-loadersrcindex.js??ref--4-3!E:webs	est
ode_modulesstylus-loaderindex.js!E:webs	estclientassetsstylesfooter.styl:88:10)
    at Module._compile (E:webs	est
ode_modulesv8-compile-cachev8-compile-cache.js:194:30)
    at evalModuleCode (E:webs	est
ode_modulesmini-css-extract-plugindistloader.js:66:10)
    at E:webs	est
ode_modulesmini-css-extract-plugindistloader.js:196:31
    at E:webs	est
ode_moduleswebpacklibCompiler.js:343:11
    at E:webs	est
ode_moduleswebpacklibCompiler.js:681:15
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:webs	est
ode_modules	apablelibHookCodeFactory.js:33:10), <anonymous>:15:1)
    at AsyncSeriesHook.lazyCompileHook (E:webs	est
ode_modules	apablelibHook.js:154:20)
    at E:webs	est
ode_moduleswebpacklibCompiler.js:678:31
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:webs	est
ode_modules	apablelibHookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (E:webs	est
ode_modules	apablelibHook.js:154:20)
    at E:webs	est
ode_moduleswebpacklibCompilation.js:1423:35
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:webs	est
ode_modules	apablelibHookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (E:webs	est
ode_modules	apablelibHook.js:154:20)
    at E:webs	est
ode_moduleswebpacklibCompilation.js:1414:32
    at eval (eval at create (E:webs	est
ode_modules	apablelibHookCodeFactory.js:33:10), <anonymous>:11:1)
    at E:webs	est
ode_modules	erser-webpack-plugindistindex.js:321:9
    at TaskRunner.run (E:webs	est
ode_modules	erser-webpack-plugindistTaskRunner.js:48:7)
    at TerserPlugin.optimizeFn (E:webs	est
ode_modules	erser-webpack-plugindistindex.js:227:18)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:webs	est
ode_modules	apablelibHookCodeFactory.js:33:10), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook (E:webs	est
ode_modules	apablelibHook.js:154:20)
    at E:webs	est
ode_moduleswebpacklibCompilation.js:1409:36
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:webs	est
ode_modules	apablelibHookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (E:webs	est
ode_modules	apablelibHook.js:154:20)
    at E:webs	est
ode_moduleswebpacklibCompilation.js:1405:32
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:webs	est
ode_modules	apablelibHookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (E:webs	est
ode_modules	apablelibHook.js:154:20)
    at Compilation.seal (E:webs	est
ode_moduleswebpacklibCompilation.js:1342:27)

 搞了一个下午,原来是加多了style-loader

{
    test: /.styl$/,
    use: [
      MiniCssExtractPlugin.loader,
      'style-loader', //要删除这个loader,不然一直报错
      'css-loader',
      {
        loader: 'postcss-loader',
        options: {
          sourceMap: true
        }
      },
      'stylus-loader'
    ]
  }

  

 

免责声明:文章转载自《Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ReferenceError: document is not defined》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇查看iOS App的bundleId再谈容器与虚拟机的那点事下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

gulp插件的使用方法

gulp插件很多,这里介绍几个比较常用的插件。。。 1.gulp-less:用于把less文件编译成css文件。      因为html文件中不能直接引用less文件(需要导入相关编译js文件配合才行),因此需要想方设法把相应less文件编译成less文件编译成css文件。除了考拉编译外,还可以通过gulp这个自动化构建工具实现less文件的编译。   在...

浏览器、HTML、css 面试题

1.什么是盒模型 盒模型(内容(content),内边距(padding),边框(border),外边距(margin)),值得注意的是,块级元素可以设置宽高,内边距,边框,外边距 行内元素宽高自动,并排显示。 2.行内元素有哪些?块级元素有哪些? 空(void)元素有那些?行内元素和块级元素有什么区别? CSS规范规定,每个元素都有display属性,确...

用JS实现回文数的精准辨别!!!

笔者最近在一边看《JS高级程序设计3》一边在FCC上找题目练习啊。那叫一个爽。这不,刚刚用生命在课堂,寝室,实验室,图书馆等各种场所将第五章“引用类型”搞定,FCC便知趣的给笔者来了个“回文数”,笔者咬牙切齿,花了两天时间,又是研究数组,又是研究字符串,又是研究作用域,还看了很长时间的正则表达式。还好,不负有心人,嘿嘿嘿,现在为大家详细分享用JS实现精准回...

JS实现纯前端将数据导出Excel两种方式亲测有效

由于项目需要,需要在不调用后台接口的情况下,将json数据导出到excel表格,参考了好多资料以及很多大佬写的博客终于实现,兼容chrome没问题,其他还没有测试过,这边介绍两种实现方式,并附上代码和gif动图,博主不才还望轻喷,代码可直接copy运行 方法一 将table标签,包括tr、td等对json数据进行拼接,将table输出到表格上实现,这种方法...

js设置div透明度

原生js设置透明度 为了兼容IE与其他浏览器对透明度的设置,我们需要对以上两种样式分别进行设置; 复制代码代码如下:var alpha = 30; //透明度值变量 var oDiv = document.getElementById('div1'); //获取DOM元素对象 oDiv.style.filter = 'alpha(opacity:'+alp...

JS中将控制台log输出显示到浏览器中

JS中将控制台log输出显示到浏览中 一、背景 有时候需要,将返回的请求数据打印在Chrome中的控制台中,方便对比数据,对比实际返回数据是否和API约定数据一致。这时需要在代码中添加console.log 片段,将数据限制在浏览器的控制台中。 二、操作 在代码添加需要返回的数据,并打印出来,在浏览器中查看。 (1)在代码中添加():...