глобальная переменная в angular 9 ошибка polyfills.ts или полный размер стека
Я разрабатываю Angular 9 с помощью vtk.js. Но возникает эта ошибка.
macro.js:35 Uncaught ReferenceError: global is not defined
at Object../node_modules/vtk.js/Sources/macro.js (macro.js:35)
at __webpack_require__ (bootstrap:79)
at Object../node_modules/vtk.js/Sources/Rendering/Misc/FullScreenRenderWindow/index.js (index.js:1)
at __webpack_require__ (bootstrap:79)
at Module../src/app/app.component.ts (app.component.ts:1)
at __webpack_require__ (bootstrap:79)
at Module../src/app/app.module.ts (app.module.ts:1)
at __webpack_require__ (bootstrap:79)
at Module../src/main.ts (main.ts:1)
at __webpack_require__ (bootstrap:79)
Итак, я вставил (окно как любое).global = window; в polyfills.ts, но также возникает эта ошибка:
ERROR RangeError: Maximum call stack size exceeded
at _typeof2 (macro.js:1)
at _typeof2 (macro.js:1)
at _typeof2 (macro.js:1)
at _typeof2 (macro.js:1)
at _typeof2 (macro.js:1)
at _typeof2 (macro.js:1)
at _typeof2 (macro.js:1)
at _typeof2 (macro.js:1)
at _typeof2 (macro.js:1)
at _typeof2 (macro.js:1)
Как я могу это решить? Помогите, если кто это знает. С уважением