Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.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
Webpack “如何修复网页包错误”;版本;是GCP cloudbuild中的必需参数_Webpack_Source Maps_Google Cloud Build - Fatal编程技术网

Webpack “如何修复网页包错误”;版本;是GCP cloudbuild中的必需参数

Webpack “如何修复网页包错误”;版本;是GCP cloudbuild中的必需参数,webpack,source-maps,google-cloud-build,Webpack,Source Maps,Google Cloud Build,我创造了一个,但我担心它会被关闭,因为他们要求一个最小的复制,我不能生产 我的cloudbuild步骤之一是: -名称:节点:$\u节点\u版本 入口点:npm 参数:['run','build:ci']#带有节点_ENV=production。跳过BundleAnalyzerPlugin 目录:“v3/client/” waitFor:['css-build','secret-available'] id:'客户端生成' 替换: #使用节点v15获取与客户端/画布包相关的错误 #命令失败sh-

我创造了一个,但我担心它会被关闭,因为他们要求一个最小的复制,我不能生产

我的cloudbuild步骤之一是:

-名称:节点:$\u节点\u版本
入口点:npm
参数:['run','build:ci']#带有节点_ENV=production。跳过BundleAnalyzerPlugin
目录:“v3/client/”
waitFor:['css-build','secret-available']
id:'客户端生成'
替换:
#使用节点v15获取与客户端/画布包相关的错误
#命令失败sh-c node pre-gyp安装--回退到生成
#未找到包“pangocairo”
_节点_版本:“14”
它触发webpack 4构建,定义如下:

“脚本”:{
“build:ci”:“NODE_ENV=生产npm运行构建--ENV ci”,
}
当cloudbuild尝试运行该步骤时,它总是失败,并出现以下错误

Step #4 - "client-built": (node:29) UnhandledPromiseRejectionWarning: Error: "version" is a required argument.
Step #4 - "client-built":     at Object.getArg (/workspace/v3/client/node_modules/webpack-sources/node_modules/source-map/lib/util.js:24:11)
Step #4 - "client-built":     at new BasicSourceMapConsumer (/workspace/v3/client/node_modules/webpack-sources/node_modules/source-map/lib/source-map-consumer.js:294:22)
Step #4 - "client-built":     at new SourceMapConsumer (/workspace/v3/client/node_modules/webpack-sources/node_modules/source-map/lib/source-map-consumer.js:22:7)
Step #4 - "client-built":     at SourceMapSource.node (/workspace/v3/client/node_modules/webpack-sources/lib/SourceMapSource.js:32:62)
Step #4 - "client-built":     at SourceMapSource.proto.sourceAndMap (/workspace/v3/client/node_modules/webpack-sources/lib/SourceAndMapMixin.js:29:18)
Step #4 - "client-built":     at getTaskForFile (/workspace/v3/client/node_modules/webpack/lib/SourceMapDevToolPlugin.js:65:30)
Step #4 - "client-built":     at /workspace/v3/client/node_modules/webpack/lib/SourceMapDevToolPlugin.js:215:20
Step #4 - "client-built":     at Array.forEach (<anonymous>)
Step #4 - "client-built":     at /workspace/v3/client/node_modules/webpack/lib/SourceMapDevToolPlugin.js:186:12
Step #4 - "client-built":     at SyncHook.eval (eval at create (/workspace/v3/client/node_modules/tapable/lib/HookCodeFactory.js:1:1), <anonymous>:12:1)
Step #4 - "client-built":     at SyncHook.lazyCompileHook (/workspace/v3/client/node_modules/tapable/lib/Hook.js:154:20)
Step #4 - "client-built":     at /workspace/v3/client/node_modules/webpack/lib/Compilation.js:1413:42
Step #4 - "client-built":     at eval (eval at create (/workspace/v3/client/node_modules/tapable/lib/HookCodeFactory.js:1:1), <anonymous>:19:1)
Step #4 - "client-built": (Use `node --trace-warnings ...` to show where the warning was created)
Step #4 - "client-built": (node:29) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
Step #4 - "client-built": (node:29) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
你知道我可以试着调试这个吗

编辑:自从上一次成功的cloudbuild构建以来,在对webpack配置进行差异化之后,我注意到了以下变化:

   resolve: {
-    extensions: [".ts", ".tsx", ".js", ".jsx"],
+    // .mjs needed from @apollo/client v3.3.0
+    extensions: [".mjs", ".ts", ".tsx", ".js", ".jsx"],
   },
但是webpack支持mjs的sourcemap,所以我想这是无关紧要的

唯一的其他更改是使用
节点:14
docker映像而不是主映像,因为自从我将
canvas
添加到jest测试的依赖项列表中以来,节点15导致npm安装错误


编辑2:为我的生产构建工作禁用源映射。但从现在起,调试生产问题将更加困难:(

我面临着同样的问题,但是有Web包5。我也使用Apollo客户端v3。一个区别是:它在gitlab ci上。根本原因是使用了
docker:dind
。从
dind
转到使用docker套接字绑定为我解决了这个问题。

得到了gitlab ci和Web包5的相同问题。在这里进行了最低限度的复制:,请参见此处的构建输出:设法跟踪错误消息,直至
css minimizer网页包插件
,并在那里打开了一个问题:谢谢,我将关注这个问题:)