webpack - To configure karma with angular universal -
i trying set universal angular karma, have problems in it, have seen several implementations of angular2 , karma, have had problems integrating universal angular.
the universal repository follow following
https://github.com/angular/universal-starter
and of karma + angular 2 this
https://github.com/rangle/angular2-redux-example https://angular-2-training-book.rangle.io/handout/testing/intro-to-tdd/setup/karma-config.html
output error
> universal-starter@2.0.0 test g:\universal2 > karma start hash: e8f2349ece4cdebf209b version: webpack 2.1.0-beta.27 time: 8565ms asset size chunks chunk names main 5.69 mb 0, 1 main src/tests.entry.ts 14.5 mb 1, 0 src/tests.entry.ts chunk {0} main (main) 5.04 mb [entry] [rendered] [0] ./~/@angular/core/index.js 355 bytes {0} {1} [built] [1] ./~/core-js/modules/_export.js 1.6 kb {0} {1} [built] [2] ./~/buffer/index.js 48.6 kb {0} {1} [built] [3] ./~/@angular/compiler/src/facade/lang.js 4.78 kb {0} {1} [built] [4] ./~/inherits/inherits_browser.js 672 bytes {0} {1} [built] [5] ./~/@angular/core/src/facade/lang.js 4.78 kb {0} {1} [built] [6] ./~/core-js/modules/_an-object.js 149 bytes {0} {1} [built] [7] (webpack)/buildin/global.js 506 bytes {0} {1} [built] [8] ./~/rxjs/observable.js 6.04 kb {0} {1} [built] [9] ./~/core-js/modules/_fails.js 99 bytes {0} {1} [built] [10] ./~/process/browser.js 5.3 kb {0} {1} [built] [11] ./~/@angular/compiler/src/output/output_ast.js 38.9 kb {0} {1} [built] [12] ./~/core-js/modules/_is-object.js 107 bytes {0} {1} [built] [13] ./~/core-js/modules/_global.js 322 bytes {0} {1} [built] [14] ./~/core-js/modules/_wks.js 368 bytes {0} {1} [built] [15] ./~/bn.js/lib/bn.js 87.2 kb {0} {1} [built] [16] ./~/@angular/compiler/src/identifiers.js 13.7 kb {0} {1} [built] [17] ./~/@angular/platform-browser/src/dom/dom_adapter.js 1.25 kb {0} {1} [built] [18] ./~/core-js/modules/_object-dp.js 608 bytes {0} {1} [built] [19] ./~/@angular/compiler/src/private_import_core.js 2.41 kb {0} {1} [built] [20] ./~/core-js/modules/_descriptors.js 177 bytes {0} {1} [built] [21] ./~/stream-browserify/index.js 3.63 kb {0} {1} [built] [22] ./~/@angular/compiler/src/compile_metadata.js 20.4 kb {0} {1} [built] [23] ./~/core-js/modules/_to-length.js 217 bytes {0} {1} [built] [24] ./~/core-js/modules/_has.js 117 bytes {0} {1} [built] ......... ......... ....... ........ [1054] ./src/tests.entry.ts 606 bytes {0} {1} [built] warning in ./src/typings.d.ts module build failed: error: debug failure. false expression: output generation failed @ object.assert (g:\universal2\node_modules\typescript\lib\typescript.js:2406:23) @ object.transpilemodule (g:\universal2\node_modules\typescript\lib\typescript.js:54350:18) @ state.fastemit (g:\universal2\node_modules\awesome-typescript-loader\src\host.ts:264:39) @ transform (g:\universal2\node_modules\awesome-typescript-loader\src\index.ts:164:28) @ transformationfunction (g:\universal2\node_modules\awesome-typescript-loader\src\index.ts:89:48) @ compiler (g:\universal2\node_modules\awesome-typescript-loader\src\index.ts:105:34) @ object.loader (g:\universal2\node_modules\awesome-typescript-loader\src\index.ts:18:18) @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts warning in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 45:15 critical dependency: request of dependency expression warning in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 57:15 critical dependency: request of dependency expression warning in ./~/express/lib/view.js 80:29 critical dependency: request of dependency expression error in ./src/tests.entry.ts module not found: error: can't resolve 'babel-polyfill' in 'g:\universal2\src' @ ./src/tests.entry.ts 2:0-25 error in ./~/express/lib/view.js module not found: error: can't resolve 'fs' in 'g:\universal2\node_modules\express\lib' @ ./~/express/lib/view.js 18:9-22 @ ./~/express/lib/application.js @ ./~/express/lib/express.js @ ./~/express/index.js @ ./src/backend/api.ts @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in ./~/destroy/index.js module not found: error: can't resolve 'fs' in 'g:\universal2\node_modules\destroy' @ ./~/destroy/index.js 14:17-30 @ ./~/send/index.js @ ./~/express/lib/utils.js @ ./~/express/lib/view.js @ ./~/express/lib/application.js @ ./~/express/lib/express.js @ ./~/express/index.js @ ./src/backend/api.ts @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in ./~/etag/index.js module not found: error: can't resolve 'fs' in 'g:\universal2\node_modules\etag' @ ./~/etag/index.js 22:12-25 @ ./~/send/index.js @ ./~/express/lib/utils.js @ ./~/express/lib/view.js @ ./~/express/lib/application.js @ ./~/express/lib/express.js @ ./~/express/index.js @ ./src/backend/api.ts @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in ./~/send/index.js module not found: error: can't resolve 'fs' in 'g:\universal2\node_modules\send' @ ./~/send/index.js 24:9-22 @ ./~/express/lib/utils.js @ ./~/express/lib/view.js @ ./~/express/lib/application.js @ ./~/express/lib/express.js @ ./~/express/index.js @ ./src/backend/api.ts @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in ./~/mime/mime.js module not found: error: can't resolve 'fs' in 'g:\universal2\node_modules\mime' @ ./~/mime/mime.js 2:9-22 @ ./~/send/index.js @ ./~/express/lib/utils.js @ ./~/express/lib/view.js @ ./~/express/lib/application.js @ ./~/express/lib/express.js @ ./~/express/index.js @ ./src/backend/api.ts @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in ./~/express/lib/request.js module not found: error: can't resolve 'net' in 'g:\universal2\node_modules\express\lib' @ ./~/express/lib/request.js 18:11-25 @ ./~/express/lib/express.js @ ./~/express/index.js @ ./src/backend/api.ts @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in ./src/client.aot.ts module not found: error: can't resolve './browser.module.ngfactory' in 'g:\universal2\src' @ ./src/client.aot.ts 15:33-70 @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in ./src/server.aot.ts module not found: error: can't resolve 'fs' in 'g:\universal2\src' @ ./src/server.aot.ts 9:9-22 @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in ./~/graceful-fs/graceful-fs.js module not found: error: can't resolve 'fs' in 'g:\universal2\node_modules\graceful-fs' @ ./~/graceful-fs/graceful-fs.js 1:9-22 @ ./~/angular2-express-engine/index.js @ ./src/server.aot.ts @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in ./~/graceful-fs/fs.js module not found: error: can't resolve 'fs' in 'g:\universal2\node_modules\graceful-fs' @ ./~/graceful-fs/fs.js 3:9-22 @ ./~/graceful-fs/polyfills.js @ ./~/graceful-fs/graceful-fs.js @ ./~/angular2-express-engine/index.js @ ./src/server.aot.ts @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in ./src/server.aot.ts module not found: error: can't resolve './node.module.ngfactory' in 'g:\universal2\src' @ ./src/server.aot.ts 21:30-64 @ ./src ^(.(?!tests\.entry))*\.ts$ @ ./src/tests.entry.ts error in [default] g:\universal2\src\+app\banner-inline.component.test.ts:6:0 cannot find name 'describe'. error in [default] g:\universal2\src\+app\banner-inline.component.test.ts:13:2 cannot find name 'beforeeach'. error in [default] g:\universal2\src\+app\banner-inline.component.test.ts:27:0 cannot find name 'it'. error in [default] g:\universal2\src\+app\banner-inline.component.test.ts:29:2 cannot find name 'expect'. error in [default] g:\universal2\src\+app\banner-inline.component.test.ts:32:0 cannot find name 'it'. error in [default] g:\universal2\src\+app\banner-inline.component.test.ts:35:2 cannot find name 'expect'. error in [default] g:\universal2\src\+app\banner-inline.component.ts:2:9 module '"g:/universal2/src/+app/model"' has no exported member 'userservice'. error in [default] g:\universal2\src\+app\banner.component.detect-changes.spec.ts:10:0 cannot find name 'describe'. error in [default] g:\universal2\src\+app\banner.component.detect-changes.spec.ts:17:2 cannot find name 'beforeeach'. error in [default] g:\universal2\src\+app\banner.component.detect-changes.spec.ts:25:4 ')' expected. error in [default] g:\universal2\src\+app\banner.component.detect-changes.spec.ts:27:2 cannot find name 'beforeeach'. error in [default] g:\universal2\src\+app\banner.component.detect-changes.spec.ts:37:0 cannot find name 'it'. error in [default] g:\universal2\src\+app\banner.component.detect-changes.spec.ts:39:2 cannot find name 'expect'. error in [default] g:\universal2\src\+app\banner.component.detect-changes.spec.ts:42:0 cannot find name 'it'. error in [default] g:\universal2\src\+app\banner.component.detect-changes.spec.ts:46:2 cannot find name 'expect'. error in [default] g:\universal2\src\+app\banner.component.detect-changes.spec.ts:49:0 cannot find name 'it'. error in [default] g:\universal2\src\+app\banner.component.detect-changes.spec.ts:52:2 cannot find name 'expect'. error in [default] g:\universal2\src\+app\main.ts:1:0 cannot find name 'describe'. error in [default] g:\universal2\src\+app\main.ts:2:2 cannot find name 'it'. error in [default] g:\universal2\src\+app\main.ts:2:46 cannot find name 'expect'. error in [default] g:\universal2\src\+app\model.ts:1:24 expression expected. error in [default] g:\universal2\src\client.aot.ts:18:36 cannot find module './browser.module.ngfactory'. error in [default] g:\universal2\src\server.aot.ts:23:36 cannot find module './node.module.ngfactory'. child html-webpack-plugin "index.html": asset size chunks chunk names index.html 3.37 kb 0 chunk {0} index.html 761 bytes [entry] [0] ./~/html-webpack-plugin/lib/loader.js!./src/index.html 761 bytes {0} [built]
putting code here extensive leave repository
https://github.com/kevinlll4/angularuniversal-karma
thanks in advance.
Comments
Post a Comment