Open jogelin opened 7 years ago
Yes, that's strange...
If you remove that lib it all works?
Looking at #6 got me thinking...
Did you install these 3rd party libs in node_modules
within the package directory (as opposed to node_modules
in the root of the project)
If I remove it, indeed it works...
Yes it was the case, like I said in the #6, I am doing that with other libraries and it works...
So I tried to put those dependencies in the devDependencies
of the root project but I have a lot of errors:
============================================
Compiling library forms
=============================================
[09:00:15] Starting '!build:webpack'...
Starting compilation using the angular compiler.
Angular compilation done, starting webpack bundling.
[09:00:21] '!build:webpack' errored after 6.21 s
[09:00:21] Error: Error File 'D:/dev/projects/viper/shared-js/node_modules/@ng2-dynamic-forms/core/src/component/dynamic-form-control-relation.utils.ts' is not under 'rootDir' 'D:/dev/projects/viper/shared-js/src/@sxpbelux'. 'rootDir' is expected to contain all source files.
Error File 'D:/dev/projects/viper/shared-js/node_modules/@ng2-dynamic-forms/core/src/component/dynamic-form-control.component.ts' is not under 'rootDir' 'D:/dev/projects/viper/shared-js/src/@sxpbelux'. 'rootDir' is expected to contain all source files.
Error File 'D:/dev/projects/viper/shared-js/node_modules/@ng2-dynamic-forms/core/src/core.module.ts' is not under 'rootDir' 'D:/dev/projects/viper/shared-js/src/@sxpbelux'. 'rootDir' is expected to contain all source files.
Error File 'D:/dev/projects/viper/shared-js/node_modules/@ng2-dynamic-forms/core/src/decorator/serializable.decorator.ts' is not under 'rootDir' 'D:/dev/projects/viper/shared-js/src/@sxpbelux'. 'rootDir' is expected to contain all source files.
Error File 'D:/dev/projects/viper/shared-js/node_modules/@ng2-dynamic-forms/core/src/directive/dynamic-id.directive.ts' is not under 'rootDir' 'D:/dev/projects/viper/shared-js/src/@sxpbelux'. 'rootDir' is expected to contain all source files.
Error File 'D:/dev/projects/viper/shared-js/node_modules/@ng2-dynamic-forms/core/src/directive/dynamic-template.directive.ts' is not under 'rootDir' 'D:/dev/projects/viper/shared-js/src/@sxpbelux'. 'rootDir' is expected to contain all source files.
Error File 'D:/dev/projects/viper/shared-js/node_modules/@ng2-dynamic-forms/core/src/model/checkbox/dynamic-checkbox-group.model.ts' is not under 'rootDir' 'D:/dev/projects/viper/shared-js/src/@sxpbelux'. 'rootDir' is expected to contain all source files.
Error File 'D:/dev/projects/viper/shared-js/node_modules/@ng2-dynamic-forms/core/src/model/checkbox/dynamic-checkbox.model.ts' is not under 'rootDir' 'D:/dev/projects/viper/shared-js/src/@sxpbelux'. 'rootDir' is expected to contain all source files.
...
same errors on 59000 lines ;)
...
Error File 'D:/dev/projects/viper/shared-js/node_modules/@ng2-dynamic-forms/ui-ng-bootstrap/src/ui-ng-bootstrap.module.ts' is not under 'rootDir' 'D:/dev/projects/viper/shared-js/src/@sxpbelux'. 'rootDir' is expected to contain all source files.
at new UserError (D:\dev\projects\viper\tools\@angular\tsc-wrapped\src\tsc.ts:33:5)
at check (D:\dev\projects\viper\tools\@angular\tsc-wrapped\src\tsc.ts:81:11)
at Tsc.typeCheck (D:\dev\projects\viper\tools\@angular\tsc-wrapped\src\tsc.ts:168:5)
at D:\dev\projects\viper\tools\@angular\tsc-wrapped\src\main.ts:143:11
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:169:7)
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I think it is because it tries to compile all .ts
files of this library but it is not in the lib folder anymore...
We shouldn't publish ts files when we make a library...should we ? How can I ignore those files ?
Hi @jogelin, I'm having a similar issue, did you find a solution for the TypeError: Cannot read property 'path' of undefined at TsickleCompilerHost.getSourceMapKeyForSourceFile
error?
Hi @DDeis, I am sorry but I can't help you. I did not solve this issue...
Thanks for the feedback @jogelin, for my part the issue happens because the TsickleCompiler host was trying to resolve the index.ts of the failing library instead of the typings file (index.d.ts).
I'm submitting a ... [X] bug report [ ] feature request [ ] question about the decisions made in the repository
Do you want to request a feature or report a bug? I am not sure if it is a bug in the builder but I don't know how to debug it...
What is the current behavior? When I build a lib with an external dependency, I have an error:
[14:52:11] Starting '!build:webpack'... Starting compilation using the angular compiler. Angular compilation done, starting webpack bundling. [14:52:16] '!build:webpack' errored after 4.11 s [14:52:16] TypeError: Cannot read property 'path' of undefined at TsickleCompilerHost.getSourceMapKeyForSourceFile (D:\dev\projects\viper\shared-js\node_modules\tsickle\src\tsickle_compiler_host.ts:197:61) at TsickleCompilerHost.closurize (D:\dev\projects\viper\shared-js\node_modules\tsickle\src\tsickle_compiler_host.ts:319:14) at TsickleCompilerHost.getSourceFile (D:\dev\projects\viper\shared-js\node_modules\tsickle\src\tsickle_compiler_host.ts:166:21) at findSourceFile (D:\dev\projects\viper\shared-js\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:67716:29) at processImportedModules (D:\dev\projects\viper\shared-js\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:67863:25) at findSourceFile (D:\dev\projects\viper\shared-js\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:67744:17) at processImportedModules (D:\dev\projects\viper\shared-js\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:67863:25) at findSourceFile (D:\dev\projects\viper\shared-js\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:67744:17) at processSourceFile (D:\dev\projects\viper\shared-js\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:67647:27) at processRootFile (D:\dev\projects\viper\shared-js\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:67535:13) at D:\dev\projects\viper\shared-js\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:66825:60 at Object.forEach (D:\dev\projects\viper\shared-js\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:1443:30) at Object.createProgram (D:\dev\projects\viper\shared-js\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:66825:16) at createProgram_1 (D:\dev\projects\viper\tools\@angular\tsc-wrapped\src\main.ts:58:17) at D:\dev\projects\viper\tools\@angular\tsc-wrapped\src\main.ts:160:28 at
ERROR: Cannot read property 'path' of undefined
[14:52:16] '!compile' errored after 43 s
{ "description": "forms", "keywords": [ ], "libConfig": { "inlineResources": true }, "dependencies": { "@ng2-dynamic-forms/core": "1.4.15", "@ng2-dynamic-forms/ui-ng-bootstrap": "1.4.15", "angular2-text-mask": "^8.0.1" }, "peerDependencies": { "@angular/core": "^4.2.3", "@angular/common": "^4.2.3", "@angular/forms": "^4.2.3", "rxjs": "^5.4.1" } }
import { NgModule } from '@angular/core'; import { DynamicFormsCoreModule } from '@ng2-dynamic-forms/core'; import { DynamicFormsNGBootstrapUIModule } from '@ng2-dynamic-forms/ui-ng-bootstrap';
@NgModule({ imports: [ DynamicFormsCoreModule.forRoot(), DynamicFormsNGBootstrapUIModule ], declarations: [ ], exports: [ ] }) export class AppFormsModule { }