gpt4 book ai didi

javascript - 使用 angular/cli 版本 1.0.0-beta.28.3 时出现非常奇怪的错误

转载 作者:太空宇宙 更新时间:2023-11-04 03:27:06 24 4
gpt4 key购买 nike

尝试为应用程序提供服务时发送此错误

86% hashingcrypto.js:74 this._handle.update(data, encoding); ^ TypeError: Data must be a string or a buffer at TypeError (native) at Hash.update (crypto.js:74:16) at HarmonyExportImportedSpecifierDependency.updateHash (C:\Users\seanr\projects\DerrickAlphaFebTest\angular- src\node_modules\@angular\cli\node_modules\webpack\lib\dependencies\HarmonyExportImportedSpecifierDependency.js:144:8) at C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\@angular\cli\node_modules\webpack\lib\DependenciesBlock.js:33:5 at Array.forEach (native) at NormalModule.DependenciesBlock.updateHash (C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\@angular\cli\node_modules\webpack\lib\DependenciesBlock.js:32:20) at NormalModule.Module.updateHash (C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\@angular\cli\node_modules\webpack\lib\Module.js:162:41) at NormalModule.updateHash (C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\@angular\cli\node_modules\webpack\lib\NormalModule.js:327:30) at modules.forEach.m (C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\@angular\cli\node_modules\webpack\lib\Chunk.js:253:31) at Array.forEach (native) at Chunk.updateHash (C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\@angular\cli\node_modules\webpack\lib\Chunk.js:253:16) at Compilation.createHash (C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:1121:10) at sealPart2 (C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:605:9) at next (C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\tapable\lib\Tapable.js:138:11) at Compilation. (C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\@angular\cli\node_modules\webpack\lib\ProgressPlugin.js:110:5) at next (C:\Users\seanr\projects\DerrickAlphaFebTest\angular-src\node_modules\tapable\lib\Tapable.js:140:14)

最佳答案

您可以通过手动编辑以下文件来改进错误消息:node_modules/webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js 并在第 144 行插入一些日志:

     updateHash(hash) {
super.updateHash(hash);
const hashValue = this.getHashValue(this.importDependency.module);
if (this.importDependency.module != null){
// console.log('Module resource: ', this.importDependency.module.resource);
}else{
console.log('\nFile not found: ', this.importDependency);
}
hash.update(hashValue);
}

然后你可以得到明确的错误消息

86% hashing                                  
File not found: HarmonyImportDependency {
module: null,
request: '@angular/cdk/a11y',
userRequest: '@angular/cdk/a11y',
range: [ 237, 339 ],
importedVar: '__WEBPACK_IMPORTED_MODULE_1__angular_cdk_a11y__',
loc:
SourceLocation {
start: Position { line: 9, column: 0 },
end: Position { line: 9, column: 102 } } }
crypto.js:97
this._handle.update(data, encoding);

然后搜索request中指定的文件,这里是@angular/cdk/a11y

就我而言,我发现名为 @angular/cdk/a11y 的文件丢失了。我安装了丢失的文件以使其正常工作

引用:Thanks to toub's answer in github

关于javascript - 使用 angular/cli 版本 1.0.0-beta.28.3 时出现非常奇怪的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43146215/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com