Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 网页包:在MacOS上很好,在linux上加载程序错误_Javascript_Node.js_Webpack - Fatal编程技术网

Javascript 网页包:在MacOS上很好,在linux上加载程序错误

Javascript 网页包:在MacOS上很好,在linux上加载程序错误,javascript,node.js,webpack,Javascript,Node.js,Webpack,我有一些网页包/原始加载程序/sass同步加载程序问题。在我本地的机器上,一切正常。但是,在我的linux CI服务器上,webpack失败 有人能给我一个如何开始诊断发生了什么的指示吗?我不太确定从哪里开始 以下是linux上的网页包输出: Hash: 314a28b414704badd07b Version: webpack 1.4.15 Time: 7350ms Asset Size Chunks Chunk Names main.js 1648

我有一些网页包/原始加载程序/sass同步加载程序问题。在我本地的机器上,一切正常。但是,在我的linux CI服务器上,webpack失败

有人能给我一个如何开始诊断发生了什么的指示吗?我不太确定从哪里开始

以下是linux上的网页包输出:

Hash: 314a28b414704badd07b
Version: webpack 1.4.15
Time: 7350ms
   Asset     Size  Chunks             Chunk Names
 main.js  1648360       0  [emitted]  main
main.css   138069       0  [emitted]  main
    + 595 hidden modules

ERROR in ./~/raw-loader!./~/autoprefixer-loader
!./node_loaders/sass-sync-loader.js?sync&outputStyle=compact&
includePaths[]=/home/u65/src/repo/desktop-prototype/.generated/design-assets&
includePaths[]=/home/u65/src/repo/desktop-prototype/.generated/design-properties&
includePaths[]=/home/u65/src/repo/desktop-prototype/app!./app/index.scss
Module build failed: 
 @ ./app/index.scss 4:14-564

<SNIP>

ERROR in ./app/index.scss Module build failed:
Error: Didn't get a result from child compiler     
at Object.<anonymous> (/home/u65/src/repo/desktop-prototype/
node_modules/extract-text-webpack-plugin/loader.js:90:22)
at Tapable.<anonymous> (/home/u65/src/repo/desktop-prototype/node_modules/webpack/lib/Compiler.js:210:10)     at /home/u65/src/repo/desktop-prototype/node_modules/webpack/lib/Compiler.js:397:12     at Tapable.next (/home/u65/src/repo/desktop-prototype/node_modules/webpack/node_modules/tapable/lib/Tapable.js:69:11)     at Object.<anonymous> (/home/u65/src/repo/desktop-prototype/node_modules/extract-text-webpack-plugin/loader.js:77:5)     at Tapable.next (/home/u65/src/repo/desktop-prototype/node_modules/webpack/node_modules/tapable/lib/Tapable.js:71:37)     at CachePlugin.<anonymous> (/home/u65/src/repo/desktop-prototype/node_modules/webpack/lib/CachePlugin.js:40:4)     at Tapable.applyPluginsAsync (/home/u65/src/repo/desktop-prototype/node_modules/webpack/node_modules/tapable/lib/Tapable.js:73:13)     at Tapable.<anonymous> (/home/u65/src/repo/desktop-prototype/node_modules/webpack/lib/Compiler.js:394:9)     at Tapable.<anonymous> (/home/u65/src/repo/desktop-prototype/node_modules/webpack/lib/Compilation.js:534:13)

<SNIP>

ERROR in ./~/raw-loader!./~/autoprefixer-loader!
./node_loaders/sass-sync-loader.js?sync&outputStyle=compact&includePaths[]=
/home/u65/src/repo/desktop-prototype/.generated/designassets&
includePaths[]=/home/u65/src/repo/desktop-prototype/.generated/design-
properties&includePaths[]=/home/u65/src/repo/desktop-prototype/
app!./app/index.scss     
Module build failed: Child extract-text-webpack-plugin:         
+ 1 hidden modules
Child extract-text-webpack-plugin:         
+ 1 hidden modules
Hash:314a28b414704badd07b
版本:网页1.4.15
时间:7350毫秒
资产大小块块名称
main.js 1648360 0[emissed]main
main.css 138069 0[emissed]main
+595隐藏模块
./~/raw loader!中出错/~/自动刷新器加载器
!./node_loaders/sass sync loader.js?sync&outputStyle=compact&
includePath[]=/home/u65/src/repo/desktop prototype/。生成/设计资产&
includePath[]=/home/u65/src/repo/desktop prototype/。生成/设计属性&
includePath[]=/home/u65/src/repo/desktop prototype/app/app/index.scss
模块生成失败:
@./app/index.scss 4:14-564
./app/index.scss模块生成失败时出错:
错误:未从子编译器获取结果
反对。(/home/u65/src/repo/desktop-prototype)/
node_modules/extract text webpack plugin/loader.js:90:22)
在Tapable。(home/u65/src/repo/desktop-prototype/node_-modules/webpack/lib/Compiler.js:210:10)在/home/u65/src/repo/desktop-prototype/node_-modules/webpack/lib/Compiler.js:397:12在Tapable.next(/home/u65/src/repo/desktop-prototype/node_-modules/webpack/node_-modules/Tapable/lib/Tapable.js:69:11)at对象)。(/home/u65/src/repo/desktop prototype/node_modules/extract text webpack plugin/loader.js:77:5)在Tapable.next(/home/u65/src/repo/desktop prototype/node_modules/webpack/node_modules/Tapable/lib/Tapable.js:71:37)在CachePlugin。Tapable.applypluginasync上的(/home/u65/src/repo/desktop prototype/node_modules/webpack/lib/CachePlugin.js:40:4)(/home/u65/src/repo/desktop prototype/node_modules/webpack/node_modules/Tapable/lib/Tapable.js:73:13)。(/home/u65/src/repo/desktop-prototype/node_-modules/webpack/lib/Compiler.js:394:9)可点击。(/home/u65/src/repo/desktop prototype/node_modules/webpack/lib/Compilation.js:534:13)
./~/raw loader!中出错/~/自动刷新加载程序!
./node_loaders/sass sync loader.js?sync&outputStyle=compact&includePaths[]=
/home/u65/src/repo/desktop prototype/。生成/指定&
includePath[]=/home/u65/src/repo/desktop prototype/。生成/设计-
properties&includePaths[]=/home/u65/src/repo/desktop prototype/
应用程序/app/index.scss
模块生成失败:子提取文本网页包插件:
+1隐藏模块
子提取文本网页包插件:
+1隐藏模块

正如@Richard_Boardman指出的,Mac不区分大小写,但Linux是。所以,case的任何拼写错误都可以在Mac-dev环境中正常工作,但在部署时会失败

您可以通过使用类似Web包的插件,强制Web包在dev server和build中更精确地匹配其文件名和路径,这样在您的dev box中而不是在服务器上时,拼写错误就会失败

安装后,您可以编写一些测试,例如:

description(“区分大小写的路径插件”,()=>{
它('不应干扰拼写正确的导入',()=>{
const getUser1=require('../src/utils/api');
expect(getUser1.toBeDefined();
});
它('导入失败时会导致文件名错误',()=>{
expect(()=>{const getUser2=require('../src/utils/API');});
});
它('导入失败时应导致路径错误',()=>{
expect(()=>{const getUser3=require('../src/Utils/api');});
});
});

在linux上是否存在传递给sass同步加载程序的
includePath
!检查你的大写字母。MacOS不区分大小写,Linux是!