I am getting below error on running ng build --prod.
An unhandled exception occurred: [BABEL] /root/catch-up-enterprise/dist/polyfills-es5.8e4ba13e1c10f0a37bb4.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "/root/catch-up-enterprise/node_modules/@angular-devkit/build-angular/node_modules/@babel/preset-env/lib/index.js") See "/tmp/ng-sg4wHH/angular-errors.log" for further details
Run Code Online (Sandbox Code Playgroud)
Error log:
[root@localhost ~]# more /tmp/ng-sg4wHH/angular-errors.log
[error] Error: [BABEL] /root/catch-up-enterprise/dist/polyfills-es5.8e4ba13e1c10f0a37bb4.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry
in ./available-plugins.js for it. (While processing: "/root/catch-up-enterprise/node_modules/@angular-devkit/build-angular/node_modules/@babel/preset-env/lib/index.js")
at getPlugin (/root/catch-up-enterprise/node_modules/@angular-devkit/build-angular/node_modules/@babel/preset-env/lib/index.js:67:11)
at Array.from.map.pluginName (/root/catch-up-enterprise/node_modules/@angular-devkit/build-angular/node_modules/@babel/preset-env/lib/index.js:258:62)
at Array.map (<anonymous>)
at _default (/root/catch-up-enterprise/node_modules/@angular-devkit/build-angular/node_modules/@babel/preset-env/lib/index.js:258:43)
at /root/catch-up-enterprise/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12 …Run Code Online (Sandbox Code Playgroud) 我希望我的应用程序在第一次按下后退按钮时将消息显示为“请再次触摸后退按钮以退出应用程序”,当再次按下时,应用程序应退出。我想我已经添加了适当的代码,但它不起作用。
该脚本作为组件附加到画布元素。该脚本包含我分配给面板(画布的子级)UI 元素的公共变量。
观察到: 当我按下后退按钮时,文本出现但只有几分之一秒,然后突然消失,下一次后退按钮按下并没有导致应用程序退出。
Desired 在第一个后退按钮按下它应该显示消息,如果第二个后退按钮按下应用程序应该在 3 秒内退出。
相关资料: Unity 2017.1.0f3
这是代码链接:
https://gist.github.com/bmohanrajbit27/431221fc80e0b247649289fd136f9cfb
public class ChangeSceneScript : MonoBehaviour
{
private bool iQuit = false;
public GameObject quitobject;
void Update()
{
if (iQuit == true)
{
if (Input.GetKeyDown(KeyCode.Escape))
{
Application.Quit();
}
}
if (Input.GetKeyDown(KeyCode.Escape))
{
quitobject.SetActive(true);
iQuit = true;
StartCoroutine(QuitingTimer());
}
}
IEnumerator QuitingTimer()
{
yield return new WaitForSeconds(3);
iQuit = false;
quitobject.SetActive(false);
}
}
Run Code Online (Sandbox Code Playgroud) 尝试运行 ngserve 命令以及 ng build --prod 时出现以下错误。
\n\nERROR in ../node_modules/mat-file-upload/lib/mat-file-upload.component.d.ts:21:21 - error TS2694: Namespace \'"/root/storeproj/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5FactoryDef\'.\n\n21 static \xc9\xb5fac: i0.\xc9\xb5\xc9\xb5FactoryDef<MatFileUploadComponent, never>;\n ~~~~~~~~~~~~\n../node_modules/mat-file-upload/lib/mat-file-upload.component.d.ts:22:18 - error TS2314: Generic type \'\xc9\xb5\xc9\xb5ComponentDefWithMeta\' requires 6 type argument(s).\n\n22 static \xc9\xb5cmp: i0.\xc9\xb5\xc9\xb5ComponentDefWithMeta<MatFileUploadComponent, "mat-file-upload", never, { "labelText": "labelText"; "selectButtonText": "selectButtonText"; "selectFilesButtonType": "selectFilesButtonType"; "uploadButtonText": "uploadButtonText"; "uploadButtonType": "uploadButtonType"; "allowMultipleFiles": "allowMultipleFiles"; "showUploadButton": "showUploadButton"; "acceptedTypes": "acceptedTypes"; "customSvgIcon": "customSvgIcon"; }, { "uploadClicked": "uploadClicked"; "selectedFilesChanged": "selectedFilesChanged"; }, never, never>;\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n../node_modules/mat-file-upload/lib/mat-file-upload.service.d.ts:4:21 - error TS2694: Namespace \'"/root/storeproj/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5FactoryDef\'.\n\n4 …Run Code Online (Sandbox Code Playgroud) 构建一个应用程序,其前端用 Angularjs 开发,后端用 Java(maven)开发。
下面是 Angular 与后端通信的 environment.prod.ts 文件。
export const environment = {
production: true,
urlAddress: 'http://localhost:8085'
};
Run Code Online (Sandbox Code Playgroud)
到目前为止,在本地部署了应用程序,我按如下方式启动前端和后端,应用程序在本地机器上运行良好 - localhost:4200
frontend
ng server --host 0.0.0.0
backend
java -jar backend.jar
Run Code Online (Sandbox Code Playgroud)
当我尝试从同一网络中的不同系统访问该应用程序时出现问题。我可以使用系统部署的 IP 地址(如下所示)而不是 localhost:4200 来访问前端。
192.168.43.214:4200
Run Code Online (Sandbox Code Playgroud)
但是到后端的连接不起作用,当我进行浏览器检查时,发现它尝试访问 localhost:8085 作为后端,因为在 environment.prod.ts 文件中硬编码了 IP 地址 localhost:8085。
当我尝试使用系统 IP 地址单独访问 java 后端服务时,jhipster 页面出现并且工作正常。
192.168.43.214:8085
Run Code Online (Sandbox Code Playgroud)
如下配置的 prod 文件解决了这个问题
export const environment = {
production: true,
urlAddress: 'http://192.168.43.214:8085'
};
Run Code Online (Sandbox Code Playgroud)
但是我必须事先知道要运行后端服务的系统的 IP 地址。
由于前端和后端都将在同一台服务器上运行。如何让 angular 使用自己的 IP 地址进行后端连接。
谢谢,
莫汉