gpt4 book ai didi

Angular 6 Auth0 - 全局未定义

转载 作者:太空狗 更新时间:2023-10-29 17:02:13 25 4
gpt4 key购买 nike

我将我的应用程序从 angular 5 升级到 angular 6。我现在收到以下错误。

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",

最佳答案

this angular thread 中也有类似的问题:

On version 6 of Angular CLI we are removing the shim for global and other node built-ins. You can read more about why this change was made in #9827 (comment).

If you are using a library that assumes these globals are present, you can try manually shimming it inside your polyfills.ts file:

// Add global to window, assigning the value of window itself.
(window as any).global = window;

添加该行应该可以解决您的错误。

关于Angular 6 Auth0 - 全局未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50209019/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com