带有角度库E /发射器的量角器e2e测试-错误:ReferenceError:未定义窗口

时间:2018-08-21 10:16:47

标签: angular-cli ng-packagr

我用angular-cli 6开发了一些角度库。 用量角器运行e2e时出现以下错误:

E/launcher - Error: ReferenceError: window is not defined
    at Object.<anonymous> (C:\Projects\p1\node_modules\ngx-bootstrap\bundles\webpack:\ngx-bootstrap.umd\webpack\universalModuleDefinition:10:2)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at C:\Users\ee44143\Projects\mifid2-ui-trunk\dist\sg-ng-core-components\bundles\sg-ng-core-components.umd.js:2:268
    at Object.<anonymous> (C:\Projects\p1\dist\sg-ng-core-components\bundles\sg-ng-core-components.umd.js:5:2)
Closing report
[11:47:28] E/launcher - Process exited with error code 100
An unexpected error occurred: undefined

这似乎是由于库sg-ng-core-components中的某些错误导致的,这些组件具有以下依赖性:

  "peerDependencies": {
    "@angular/common": "^6.0.0-rc.0 || ^6.0.0",
    "@angular/core": "^6.0.0-rc.0 || ^6.0.0",
    "@angular/platform-browser": "^6.0.0-rc.0 || ^6.0.0",
    "@angular/platform-browser-dynamic": "^6.0.0-rc.0 || ^6.0.0",
    "@angular/http": "^6.0.0-rc.0 || ^6.0.0",
    "@angular/router": "^6.0.0-rc.0 || ^6.0.0",
    "ngx-bootstrap": "^3.0.1",
    "rxjs": "^6.2.1",
    "rxjs-compat": "^6.2.1"
  },

在Google上,我找不到解决方案。 有人知道如何解决这个问题吗?

0 个答案:

没有答案