Closed
Description
Card.js is throwing errors in Angular 6 which makes it unusable.
ERROR ReferenceError: global is not defined at Card.js:205 at construct (Card.js:210) at Card (Card.js:364) at Object.Stack.stack.createCard (Stack.js:81) at SwingStackComponent.push../node_modules/angular2-swing/dist/swing-stack-component.js.SwingStackComponent.addCard (swing-stack-component.js:24) at SwingCardComponent.push../node_modules/angular2-swing/dist/swing-card-component.js.SwingCardComponent.ngOnInit (swing-card-component.js:12) at checkAndUpdateDirectiveInline (core.js:10097) at checkAndUpdateNodeInline (core.js:11363) at checkAndUpdateNode (core.js:11325) at debugCheckAndUpdateNode (core.js:11962)
Activity
vp93 commentedon Jun 2, 2018
There are 2 ways to fix this :
#1. You can either add these following lines in the < head > element of your index.html:
#2. A cleaner fix would be to add this line as the first line in the polyfills.ts file :
This issue started with the release of angular5 as the app tries to refer to the window element ( in this case , from Card.js ) before angular attaches the 'global' variable to it.
mashhoodr commentedon Jun 4, 2018
dup of (#44)