Angular 6 Auth0-全局未定义 [英] Angular 6 Auth0 - global not defined
问题描述
我已将我的应用程序从5号角升级到6号角.我现在收到以下错误.
Ive upgraded my app from angular 5 to angular 6. i get the following error now.
Uncaught ReferenceError: global is not defined
at Object../node_modules/auth0-lock/lib/utils/cdn_utils.js (cdn_utils.js:13)
"angular2-jwt":"^ 0.2.3","auth0-js":"^ 9.5.1","auth0-lock": "^ 11.6.1",
"angular2-jwt": "^0.2.3", "auth0-js": "^9.5.1", "auth0-lock": "^11.6.1",
推荐答案
在Angular CLI的版本6中,我们删除了 On version 6 of Angular CLI we are removing the shim for 如果您使用的库假定存在这些全局变量,则您
可以尝试将其手动填充到 If you are using a library that assumes these globals are present, you
can try manually shimming it inside your 添加该行可以解决您的错误. Adding the line should resolve your error. 这篇关于Angular 6 Auth0-全局未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!global
的填充程序,并且
其他节点内置.您可以阅读有关为何进行此更改的更多信息
在#9827 (评论)中.
global
and
other node built-ins. You can read more about why this change was made
in #9827 (comment).polyfills.ts
文件中: polyfills.ts
file:// Add global to window, assigning the value of window itself.
(window as any).global = window;
// Add global to window, assigning the value of window itself.
(window as any).global = window;