小编Mat*_*t M的帖子

'compilation' 参数必须是 Compilation 的实例

在我的 Angular 12.0.2 项目上运行“ng build”时出现此错误

./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
TypeError: The 'compilation' argument must be an instance of Compilation
    at getCompilationHooks (D:\Dev\Git_Merc\mercury\node_modules\webpack\lib\javascript\JavascriptModulesPlugin.js:125:10)
    at D:\Dev\Git_Merc\mercury\node_modules\webpack\lib\javascript\CommonJsChunkFormatPlugin.js:43:19
    at Hook.eval [as call] (eval at create (D:\Dev\Git_Merc\mercury\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Hook.CALL_DELEGATE [as _call] (D:\Dev\Git_Merc\mercury\node_modules\tapable\lib\Hook.js:14:14)
    at Compiler.newCompilation (D:\Dev\Git_Merc\mercury\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\Compiler.js:1030:30)
    at D:\Dev\Git_Merc\mercury\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\Compiler.js:1073:29
    at Hook.eval [as callAsync] (eval at create (D:\Dev\Git_Merc\mercury\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (D:\Dev\Git_Merc\mercury\node_modules\tapable\lib\Hook.js:18:14)
    at Compiler.compile (D:\Dev\Git_Merc\mercury\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\Compiler.js:1068:28)
    at Compiler.runAsChild (D:\Dev\Git_Merc\mercury\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\Compiler.js:520:8)
Run Code Online (Sandbox Code Playgroud)

我一直在谷歌上搜索,但找不到任何可以解决我的问题的东西。我不确定是什么触发了这个。

版本:

Angular CLI: 12.0.2
Node: 14.17.0
Package Manager: npm 7.14.0
OS: win32 …
Run Code Online (Sandbox Code Playgroud)

angular-cli

23
推荐指数
3
解决办法
4万
查看次数

Visual Studio 2022 - 仅我的代码调试不起作用?

我正在使用 VS 2022,无论我更改什么设置,我都无法停止尝试进入已编译的依赖项。我有一个正在发生的异常,它被吞没了,如下所示:

在此输入图像描述

我尝试重置 VS22 的 C# 设置,并确保启用“仅我的代码”。

在此输入图像描述

visual-studio-2022

14
推荐指数
2
解决办法
2万
查看次数

VSTS Rest API 环境 ID 不正确

我正在使用 VSTS 的 REST API 来启动特定环境的发布。但是,检索环境等工作正常,当我进行 REST 调用以实际开始部署时,我收到以下错误消息:

[DBG]: PS C:\Users\mmulhe200>> 
executeRequest : {"$id":"1","innerException":null,"message":"Environment with ID '16' is not valid. Valid environments have IDs 
'1288,1289'. Specify a valid environment and try 
again.","typeName":"Microsoft.VisualStudio.Services.ReleaseManagement.Data.Exceptions.InvalidRequestException, 
Microsoft.VisualStudio.Services.ReleaseManagement2.Data","typeKey":"InvalidRequestException","errorCode":0,"eventId":3000}
At C:\Users\mmulhe200\Desktop\VSTS release task\test\Untitled1.ps1:58 char:12
+     return executeRequest $request;
+            ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,executeRequest
Run Code Online (Sandbox Code Playgroud)

有趣的是来自 REST 操作的响应以检索具有其环境的发布定义返回如下:

...
"id": 16,
"name": "Environment 2",
"rank": 2,
...
Run Code Online (Sandbox Code Playgroud)

事实上,在整个响应中,我在任何地方都找不到 ID 1288 和 1289。关于为什么 VSTS 告诉我我的环境 ID 16 是错误的,即使这是从他们的服务返回的任何想法?

rest azure-pipelines-release-pipeline

5
推荐指数
1
解决办法
429
查看次数

在 Linux Web 应用程序上的 Azure 中运行 Angular

我一直在尝试让我的 Angular 应用程序在 Azure Linux Web 应用程序上本地运行。我能够做到的唯一方法是使用 Docker,虽然这很好,但 Azure 似乎使用 Docker,所以我在 Docker 容器中运行 Docker 容器。我更愿意在本地运行该应用程序。但是,我一直无法启动该应用程序,因为我在尝试为该应用程序提供服务时收到“ng 不是已知命令”。我看不到安装 Angular CLI 的方法。令人惊讶的是缺乏这方面的文档。有没有人能够做到这一点?

azure angular azure-linux

5
推荐指数
1
解决办法
1267
查看次数

无法使用承载令牌访问AAD安全Web API

我有一个使用Azure AD(AAD)保护的API应用程序.我还有一个消费应用程序的AAD应用程序,在消费应用程序中,我已经设置了访问API应用程序的权限.

我能够获得一个令牌,但是当我去使用令牌时,API应用程序似乎没有查看Authorization标头.它试图通过网络浏览器登录我.

我的请求看起来像这样:

    GET /api/ticketing/issueTopics HTTP/1.1
    Host: <removed>
    Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGc<rest is removed>
    Cache-Control: no-cache
Run Code Online (Sandbox Code Playgroud)

这就是我的小提琴手的样子.

我在Postman中得到的结果是一些MS重定向页面:

<html>
<head>
    <title>Working...</title>
</head>
<body>
    <form method="POST" name="hiddenform" action="<removed>/.auth/login/aad/callback">
        <input type="hidden" name="id_token" value="<bearer token removed>" />
        <input type="hidden" name="state" value="/api/ticketing/issueTopics" />
        <input type="hidden" name="session_state" value="<removed>" />
        <noscript>
            <p>Script is disabled. Click Submit to continue.</p>
            <input type="submit" value="Submit" />
        </noscript>
    </form>
    <script language="javascript">document.forms[0].submit();</script>
</body>
Run Code Online (Sandbox Code Playgroud)

我删除的持有者令牌,在反序列化时,其中包含我的信息,而不是我的消费应用程序.因此,它试图验证我,而不是使用持票人令牌进行身份验证.

任何想法如何解决这一问题?

更新1

通过更新的方式,我拉下来与我的消费应用程序的servicePrincipal数据,上面清清楚楚地写着消费应用程序应该能够交谈的API应用程序.

    "oauth2Permissions": [{
        "adminConsentDescription": "Allow the application to access Ticketing API on behalf of the signed-in …
Run Code Online (Sandbox Code Playgroud)

azure azure-active-directory azure-api-apps

3
推荐指数
1
解决办法
2205
查看次数

Azure SignalR:HubException 方法不存在

我发现我们收到此错误:

Failed to invoke 'CreateChatRequest' due to an error on the server. HubException: Method does not exist.
at _this.callbacks.<computed> (chat.min.js:2060)
at HubConnection.processIncomingData (chat.min.js:2154)
at WebSocketTransport.HubConnection.connection.onreceive (chat.min.js:1881)
at WebSocket.webSocket.onmessage (chat.min.js:3922)
Run Code Online (Sandbox Code Playgroud)

该方法确实存在。该代码确实有效,然后经过一段时间的测试,它会返回此内容并且不会停止。

似乎可以暂时解决问题的是重新启动 Azure SigR 服务,但它又回来了。在开发过程中以本地 SigR 为目标时不会出现此问题;它只发生在 Azure SigR 上。

根据文档,当服务器上出现错误时,这似乎是一个包罗万象的错误,但没有记录任何异常。我已经打开了详细的错误,但这并没有改变从服务器返回的错误。我还尝试捕获异常并发回 HubException 以查看发生了什么,但这也没有改变错误消息。

TIA 寻求任何帮助。

azure signalr-hub azure-signalr

2
推荐指数
1
解决办法
2159
查看次数

Quill 导入导致“缺少依赖项”错误

我们正在尝试升级到 Angular 11,但发现这Quill.import会导致错误:

An error occurred during the build:
Error: The target entry-point "@project/project-pattern-lib" has missing dependencies:
 - core/module
 - blots/block/embed
 - modules/clipboard
 - delta
 - formats/link

    at TargetedEntryPointFinder.findEntryPoints (D:\Dev\Git_project\project\node_modules\@angular\compiler-cli\ngcc\src\entry_point_finder\targeted_entry_point_finder.js:40:23)
    at D:\Dev\Git_project\project\node_modules\@angular\compiler-cli\ngcc\src\execution\analyze_entry_points.js:29:41
r.js:28:29)
    at SyncLocker.lock (D:\Dev\Git_project\project\node_modules\@angular\compiler-cli\ngcc\src\locking\sync_locker.js:34:24)
    at SingleProcessExecutorSync.execute (D:\Dev\Git_project\project\node_modules\@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:27)
    at Object.mainNgcc (D:\Dev\Git_project\project\node_modules\@angular\compiler-cli\ngcc\src\main.js:74:25)
    at Object.process (D:\Dev\Git_project\project\node_modules\@angular\compiler-cli\ngcc\index.js:29:23)
    at NgccProcessor.processModule (D:\Dev\Git_project\project\node_modules\@ngtools\webpack\src\ngcc_processor.js:163:16)
    at D:\Dev\Git_project\project\node_modules\@ngtools\webpack\src\ivy\host.js:109:18
    at D:\Dev\Git_project\project\node_modules\@ngtools\webpack\src\ivy\host.js:39:24
    at Array.map (<anonymous>)
    at Object.host.resolveModuleNames (D:\Dev\Git_project\project\node_modules\@ngtools\webpack\src\ivy\host.js:37:32)
    at actualResolveModuleNamesWorker (D:\Dev\Git_project\project\node_modules\typescript\lib\typescript.js:102904:133)
    at resolveModuleNamesWorker (D:\Dev\Git_project\project\node_modules\typescript\lib\typescript.js:103126:26)
    at resolveModuleNamesReusingOldState (D:\Dev\Git_project\project\node_modules\typescript\lib\typescript.js:103200:24)
 - core/module
 - blots/block/embed
 - modules/clipboard
 - delta
 - formats/link

See …
Run Code Online (Sandbox Code Playgroud)

quill

0
推荐指数
1
解决办法
361
查看次数