Topic: Error Error in mdbootstrap installation
                  
                  Hector Alejandro Rodriguez
                  free
                  asked 7 years ago
                
I'm installing the mdbootstrap free library in my project of universal angular, at the time of compiling to test if the installation was correct, I have the following error from the library chart.js
C:\Users\criacao\Documents\project\universal\modelo\node_modules\chart.js\src\core\core.helpers.js:672
                return window.requestAnimationFrame ||
                ^
ReferenceError: window is not defined
    at C:\Users\criacao\Documents\project\universal\modelo\node_modules\chart.js\src\core\core.helpers.js:672:3
    at module.exports (C:\Users\criacao\Documents\project\universal\modelo\node_modules\chart.js\src\core\core.helpers.js:680:3)
    at Object.<anonymous> (C:\Users\criacao\Documents\project\universal\modelo\node_modules\chart.js\src\chart.js:6:31)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
                
                  FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
              Resolved
Specification of the issue
              - ForumUser: Free
 - Premium support: No
 - Technology: MDB Angular
 - MDB Version: -
 - Device: -
 - Browser: -
 - OS: -
 - Provided sample code: No
 - Provided link: No
 
Tags
                  
Damian Gemza staff commented 7 years ago
Dear Hector, As you can see, your error is not coming from MDB Angular, but from chart.js library. Please check our official integrating MDB Angular with Angular Universal guide to get the solution of your case: https://mdbootstrap.com/angular/angular-universal/ You have to add: global['window'] = win; into your server file. Best Regards, Damian