Angular 2 外部库错误
Angular 2 external lib error
我用 yeoman generator 生成我的 angular 2 库并添加到主 angular 项目中。如果我在开发模式下编译应用程序我没有错误,但是如果我 运行 生产模式,我会得到很多错误:
WARNING in ./src/$$_gendir/app/services/main/main.component.ngfactory.ts
142:86-92 "export 'ɵb' (imported as 'i15') was not found in 'ngx-tel-input'
at HarmonyImportSpecifierDependency._getErrors (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:677:24)
at Compilation.finish (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:535:9)
at applyPluginsParallel.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compiler.js:512:17)
at /Users/franke/projects/work/jsapp/node_modules/tapable/lib/Tapable.js:271:11
at _addModuleChain (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:481:11)
at processModuleDependencies.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:452:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
WARNING in ./src/$$_gendir/app/services/main/main.component.ngfactory.ts
144:12-18 "export 'ɵb' (imported as 'i15') was not found in 'ngx-tel-input'
at HarmonyImportSpecifierDependency._getErrors (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:677:24)
at Compilation.finish (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:535:9)
at applyPluginsParallel.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compiler.js:512:17)
at /Users/franke/projects/work/jsapp/node_modules/tapable/lib/Tapable.js:271:11
at _addModuleChain (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:481:11)
at processModuleDependencies.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:452:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
WARNING in ./src/$$_gendir/node_modules/ngx-tel-input/ngx-tel-input.ngfactory.ts
148:12-17 "export 'ɵb' (imported as 'i1') was not found in 'ngx-tel-input'
at HarmonyImportSpecifierDependency._getErrors (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:677:24)
at Compilation.finish (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:535:9)
at applyPluginsParallel.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compiler.js:512:17)
at /Users/franke/projects/work/jsapp/node_modules/tapable/lib/Tapable.js:271:11
at _addModuleChain (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:481:11)
at processModuleDependencies.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:452:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
WARNING in ./src/$$_gendir/node_modules/ngx-tel-input/ngx-tel-input.ngfactory.ts
148:46-51 "export 'ɵb' (imported as 'i1') was not found in 'ngx-tel-input'
at HarmonyImportSpecifierDependency._getErrors (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:677:24)
at Compilation.finish (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:535:9)
at applyPluginsParallel.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compiler.js:512:17)
at /Users/franke/projects/work/jsapp/node_modules/tapable/lib/Tapable.js:271:11
at _addModuleChain (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:481:11)
at processModuleDependencies.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:452:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
WARNING in ./src/$$_gendir/node_modules/ngx-tel-input/ngx-tel-input.ngfactory.ts
152:46-51 "export 'ɵb' (imported as 'i1') was not found in 'ngx-tel-input'
at HarmonyImportSpecifierDependency._getErrors (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:677:24)
at Compilation.finish (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:535:9)
at applyPluginsParallel.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compiler.js:512:17)
at /Users/franke/projects/work/jsapp/node_modules/tapable/lib/Tapable.js:271:11
at _addModuleChain (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:481:11)
at processModuleDependencies.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:452:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
ERROR in ng:///Users/franke/projects/work/jsapp/node_modules/ngx-tel-input/ngx-tel-input.d.ts.ɵb.html (4,6): Property 'number' does not exist on type 'TelInputComponent'.
有什么问题,我该如何解决?
您的意图可能只是导出需要的内容,但您需要导出 src/index.ts
文件中的所有内容,包括所有服务、指令和管道。
我用 yeoman generator 生成我的 angular 2 库并添加到主 angular 项目中。如果我在开发模式下编译应用程序我没有错误,但是如果我 运行 生产模式,我会得到很多错误:
WARNING in ./src/$$_gendir/app/services/main/main.component.ngfactory.ts
142:86-92 "export 'ɵb' (imported as 'i15') was not found in 'ngx-tel-input'
at HarmonyImportSpecifierDependency._getErrors (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:677:24)
at Compilation.finish (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:535:9)
at applyPluginsParallel.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compiler.js:512:17)
at /Users/franke/projects/work/jsapp/node_modules/tapable/lib/Tapable.js:271:11
at _addModuleChain (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:481:11)
at processModuleDependencies.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:452:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
WARNING in ./src/$$_gendir/app/services/main/main.component.ngfactory.ts
144:12-18 "export 'ɵb' (imported as 'i15') was not found in 'ngx-tel-input'
at HarmonyImportSpecifierDependency._getErrors (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:677:24)
at Compilation.finish (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:535:9)
at applyPluginsParallel.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compiler.js:512:17)
at /Users/franke/projects/work/jsapp/node_modules/tapable/lib/Tapable.js:271:11
at _addModuleChain (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:481:11)
at processModuleDependencies.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:452:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
WARNING in ./src/$$_gendir/node_modules/ngx-tel-input/ngx-tel-input.ngfactory.ts
148:12-17 "export 'ɵb' (imported as 'i1') was not found in 'ngx-tel-input'
at HarmonyImportSpecifierDependency._getErrors (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:677:24)
at Compilation.finish (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:535:9)
at applyPluginsParallel.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compiler.js:512:17)
at /Users/franke/projects/work/jsapp/node_modules/tapable/lib/Tapable.js:271:11
at _addModuleChain (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:481:11)
at processModuleDependencies.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:452:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
WARNING in ./src/$$_gendir/node_modules/ngx-tel-input/ngx-tel-input.ngfactory.ts
148:46-51 "export 'ɵb' (imported as 'i1') was not found in 'ngx-tel-input'
at HarmonyImportSpecifierDependency._getErrors (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:677:24)
at Compilation.finish (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:535:9)
at applyPluginsParallel.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compiler.js:512:17)
at /Users/franke/projects/work/jsapp/node_modules/tapable/lib/Tapable.js:271:11
at _addModuleChain (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:481:11)
at processModuleDependencies.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:452:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
WARNING in ./src/$$_gendir/node_modules/ngx-tel-input/ngx-tel-input.ngfactory.ts
152:46-51 "export 'ɵb' (imported as 'i1') was not found in 'ngx-tel-input'
at HarmonyImportSpecifierDependency._getErrors (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:677:24)
at Compilation.finish (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:535:9)
at applyPluginsParallel.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compiler.js:512:17)
at /Users/franke/projects/work/jsapp/node_modules/tapable/lib/Tapable.js:271:11
at _addModuleChain (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:481:11)
at processModuleDependencies.err (/Users/franke/projects/work/jsapp/node_modules/webpack/lib/Compilation.js:452:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
ERROR in ng:///Users/franke/projects/work/jsapp/node_modules/ngx-tel-input/ngx-tel-input.d.ts.ɵb.html (4,6): Property 'number' does not exist on type 'TelInputComponent'.
有什么问题,我该如何解决?
您的意图可能只是导出需要的内容,但您需要导出 src/index.ts
文件中的所有内容,包括所有服务、指令和管道。