【发布时间】:2018-05-13 07:26:39
【问题描述】:
当我尝试使用 cosmicjs 为我的 Angular 6 应用程序提供服务时出现以下错误:
Uncaught ReferenceError: process is not defined
at Object../node_modules/cosmicjs/dist/index.js (index.js:6)
at __webpack_require__ (bootstrap:81)
at Object../src/app/app.component.ts (main.js:94)
at __webpack_require__ (bootstrap:81)
at Object../src/app/app.module.ts (app.component.ts:9)
at __webpack_require__ (bootstrap:81)
at Object../src/main.ts (environment.ts:18)
at __webpack_require__ (bootstrap:81)
at Object.0 (main.ts:12)
at __webpack_require__ (bootstrap:81)
我的最新理论与未定义的 process.env 属性有关。
我正在关注这个教程here
我的确切代码可以在here找到
本教程似乎使用的是旧版本的 angular,它使用 .angular-cli.json 而不是新的 angular.json,我认为这是尝试指定环境变量的问题的一部分。
【问题讨论】:
标签: javascript angular angular6