msal - msal 问题:意外的令牌 < 在 Angular 5 应用程序中
问题描述
几天以来,我一直在尝试解决此问题,我们将不胜感激。我正在尝试在 Angular 5 应用程序中导入 msal(v0.2.0)。我正在做的事情是:
import '../../../../../node_modules/msal/dist/msal'
/// <reference path="../../../../../node_modules/msal/dist/msal"/>
import * as Msal from 'msal'
因此,每当我运行我的应用程序并尝试浏览它时,我都会得到:
localhost/:64 SyntaxError: Unexpected token < at evaluate ( http://localhost:5555/node_modules/systemjs/dist/system.src.js?1533829762220:2802:16 ) 在http://localhost:5555/node_modules/systemjs /dist/system.src.js?1533829762220:3607:23 在 doEvaluate ( http://localhost:5555/node_modules/systemjs/dist/system.src.js?1533829762220:1138:28 ) 在 doEvaluate ( http:// localhost:5555/node_modules/systemjs/dist/system.src.js?1533829762220:1085:15 ) 在 ensureEvaluate ( http://localhost:5555/node_modules/systemjs/dist/system.src.js?1533829762220:993:15 ) 在http://localhost:5555/node_modules/systemjs/dist/system.src.js?1533829762220:1011:22 在 Object.eval (http://localhost:5555/app/shared/auth/auth.service.js:54:1)在评估(http://localhost:5555/app/shared/auth/auth.service.js:337:4 ) 在 eval ( http://localhost:5555/app/shared/auth/auth.service.js:338:3 )
有没有办法解决 ?这是在 Angular 5 应用程序中导入 msal 的正确方法吗?
任何帮助将不胜感激。
解决方案
通过将 msal 添加到 project.config.ts 文件来解决此问题。
{ 名称:'msal',路径:'node_modules/msal/dist/msal.js' }
推荐阅读
- apache-spark - Hive hql 到 Spark sql 的转换
- ios - 无法将 cer 文件导出到 .p12 文件,该选项已禁用
- c# - 将文件保存在不同位置时的hwnd窗口句柄问题
- python - 从每列中删除零并使用 python pandas/numpy 重新排列
- javascript - 无法访问集合 Firestore 中的文档
- javascript - 为什么带数字的键出现在以下对象中的字母之前?
- javascript - 我能找出这个错误的真正原因吗?(反应原生)
- c - 找不到发生分段错误的原因
- javascript - Javascript (extjs) : 只选中两个中的一个复选框
- reactjs - 在 Kubernetes Ingress 后面使用 HTTPS 和后端 API 运行 ReactJS 应用程序