Angular 6 - process is not defined when trying to serve application

后端 未结 5 1839
心在旅途
心在旅途 2020-11-30 08:43

I am getting the following error when I try to serve my angular 6 application using cosmicjs:

Uncaught ReferenceError: process is not defined
    at Object..         


        
5条回答
  •  既然无缘
    2020-11-30 09:18

    To fix the problem, I added the following lines to 'polyfills.ts' file,

    (window as any).global = window;
    global.Buffer = global.Buffer || require('buffer').Buffer;
    global.process = require('process');
    

提交回复
热议问题