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

后端 未结 5 1853
心在旅途
心在旅途 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:26

    As long as you are not satisfied with putting some random logic into polyfills.ts and looking for a way to actually access the process.env in your Angular application please find below solution.

    Change your "builder": "@angular-devkit/build-angular:dev-server" to "builder": "@angular-builders/custom-webpack:dev-server" in angular.json.

提交回复
热议问题