Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.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
找不到模块";算法/RSASSA-PKCS1-v1_5“;使用Angular 6和rdflib 0.19.0_Angular_Webcrypto Api_Solid - Fatal编程技术网

找不到模块";算法/RSASSA-PKCS1-v1_5“;使用Angular 6和rdflib 0.19.0

找不到模块";算法/RSASSA-PKCS1-v1_5“;使用Angular 6和rdflib 0.19.0,angular,webcrypto-api,solid,Angular,Webcrypto Api,Solid,我正在开发一个Angular6+()。应用程序本身取决于: "crypto-js": "^3.1.9-1", "rdflib": "^0.19.0", "solid-auth-client": "^2.2.6", "stream": "0.0.2", "webcrypto": "^0.1.1", "zone.js": "^0.8.26" 我尝试使用以下方法删除RDF资源: 您可以在JSDoc中找到关于UpdateManager的更多信息,以及rdflib.js的介绍 现在,使用Firefox6

我正在开发一个Angular6+()。应用程序本身取决于:

"crypto-js": "^3.1.9-1",
"rdflib": "^0.19.0",
"solid-auth-client": "^2.2.6",
"stream": "0.0.2",
"webcrypto": "^0.1.1",
"zone.js": "^0.8.26"
我尝试使用以下方法删除RDF资源:

您可以在JSDoc中找到关于
UpdateManager
的更多信息,以及rdflib.js的介绍

现在,使用Firefox
63.0b12(64位)
,我不断得到以下错误,我认为这可能与访问WebCryptoAPI(也就是说
https://
页面)有关。使用Opera时会触发相同的错误

Unhandled Promise rejection: Cannot find module "../algorithms/RSASSA-PKCS1-v1_5". ; Zone: <root> ; Task: Promise.then ; Value: Error: Cannot find module "../algorithms/RSASSA-PKCS1-v1_5".
at webpackEmptyContext (algorithms sync:2)
at SupportedAlgorithms.normalize (SupportedAlgorithms.js:84)
at SubtleCrypto.importKey (SubtleCrypto.js:279)
at RSASSA_PKCS1_v1_5.importKey (RSASSA-PKCS1-v1_5.js:124)
at Function.importKey (JWA.js:113)
at Function.importKey (JWK.js:46)
at Function.issueFor (PoPToken.js:57)
at webid-oidc.js:183
at fetchWithCredentials (authn-fetch.js:63)
at authn-fetch.js:41 Error: Cannot find module "../algorithms/RSASSA-PKCS1-v1_5".
at webpackEmptyContext (http://localhost:4200/main.js:11:10)
at SupportedAlgorithms.normalize (http://localhost:4200/vendor.js:132732:107)
at SubtleCrypto.importKey (http://localhost:4200/vendor.js:132336:51)
at RSASSA_PKCS1_v1_5.importKey (http://localhost:4200/vendor.js:124747:28)
at Function.importKey (http://localhost:4200/vendor.js:125342:34)
at Function.importKey (http://localhost:4200/vendor.js:125411:18)
at Function.issueFor (http://localhost:4200/vendor.js:127189:18)
at http://localhost:4200/vendor.js:185374:44
at fetchWithCredentials (http://localhost:4200/vendor.js:184423:49)
at http://localhost:4200/vendor.js:184401:16
未处理的承诺拒绝:找不到模块“./algorithms/RSASSA-PKCS1-v1_5”;区域:;任务:承诺;值:错误:找不到模块“./算法/RSASSA-PKCS1-v1_5”。
在WebPackagemptyContext(算法同步:2)
在SupportedAlgorithms.normalize(SupportedAlgorithms.js:84)
在subtelcrypto.importKey(subtelcrypto.js:279)处
在RSASSA_PKCS1_v1_5.importKey上(RSASSA-PKCS1-v1_5.js:124)
在Function.importKey(JWA.js:113)
在Function.importKey(JWK.js:46)
位于Function.issueFor(PoPToken.js:57)
在webid oidc.js:183
at fetchWithCredentials(authn fetch.js:63)
在authn fetch.js:41错误:找不到模块“./algorithms/RSASSA-PKCS1-v1_5”。
在webpacketmptycontext(http://localhost:4200/main.js:11:10)
在SupportedAlgorithms.normalize(http://localhost:4200/vendor.js:132732:107)
在sublecrypto.importKey处(http://localhost:4200/vendor.js:132336:51)
在RSASSA_PKCS1_v1_5.importKey(http://localhost:4200/vendor.js:124747:28)
在Function.importKey(http://localhost:4200/vendor.js:125342:34)
在Function.importKey(http://localhost:4200/vendor.js:125411:18)
在Function.issueFor(http://localhost:4200/vendor.js:127189:18)
在http://localhost:4200/vendor.js:185374:44
至少要有证书(http://localhost:4200/vendor.js:184423:49)
在http://localhost:4200/vendor.js:184401:16

我是否缺少npm依赖项?此问题的根本原因是什么?

调用此代码时,我遇到了相同的错误:

import auth from 'solid-auth-client';

// for example in a button click handling, this gives me the error:
auth.logout();
使用纱线、webpack 4和babel 7

依赖项:

"@material-ui/core": "^3.2.0",
"rdflib": "^0.19.0",
"react": "^16.5.2",
"react-dom": "^16.5.2"
“@trust/webcrypto”模块(版本0.9.2)处理其他模块动态加载的方式会在我的构建中触发警告:

WARNING in ./node_modules/@trust/webcrypto/src/algorithms/SupportedAlgorithms.js 84:22-60
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/@trust/webcrypto/src/algorithms/index.js
 @ ./node_modules/@trust/webcrypto/src/SubtleCrypto.js
 @ ./node_modules/@trust/webcrypto/src/Crypto.js
 @ ./node_modules/@trust/webcrypto/src/index.js
 @ ./node_modules/@solid/oidc-rp/src/AuthenticationRequest.js
 @ ./node_modules/@solid/oidc-rp/src/RelyingParty.js
 @ ./node_modules/@solid/oidc-rp/src/index.js
 @ ./node_modules/solid-auth-client/lib/webid-oidc.js
 @ ./node_modules/solid-auth-client/lib/solid-auth-client.js
 @ ./node_modules/solid-auth-client/lib/index.js
 @ ./src/main/index.js
 @ multi (webpack)-dev-server/client?http://localhost:3000 @babel/polyfill ./src/main/index.js
听起来有点相关…

在这里回答了我的问题(以及我对解决方案的请求):

@trust/webcrypto
模块仅用作后端的NodeJS模块。要将其从网页包捆绑中排除,可以使用外部模块(由浏览器提供)替换它,例如:

externals: {
  '@trust/webcrypto': 'crypto',
  'text-encoding': 'TextEncoder',
}

PS:他还建议将文本编码模块外部化,这也是一个浏览器可用的模块。

我已经将此作为一个问题报告给了,但是@trust/webcrypto模块是一个nodejs模块,不适合在web浏览器中使用。例如,它调用openssl生成密钥。web应用程序的实体库需要使用@trust/webcrypto以外的其他库。。。似乎是这样。你把这个
externals
definition放在哪里了?可以在
angular.json
中使用它吗?我不知道angular配置是如何工作的。很抱歉我提到的配置是针对Webpack配置文件的。
externals: {
  '@trust/webcrypto': 'crypto',
  'text-encoding': 'TextEncoder',
}