Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version of tsickle (0.36.0) gives an error trying to build a library using ng build. Works fine with previous version( 0.35.0) #1046

Closed
rinavin opened this issue Jul 23, 2019 · 6 comments

Comments

@rinavin
Copy link

rinavin commented Jul 23, 2019

To reproduce :
Please get the sample repository from : https://github.com/rinavin/Webclient.git
• Do npm install
• Run: ng build mscorelib ( this is a library)
• See the error bellow.

Works fine with version tsickle (0.35.0)
• Delete node_modules and package-lock.json
• Do npm install
• Run: ng build mscorelib ( this is a library)
• See library is created succesfully

BUILD ERROR
: TypeError: Cannot read property 'directoryExists' of undefined
at Object.directoryProbablyExists (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:12206:22)
at nodeLoadModuleByRelativeName (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26869:25)
at tryResolve (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26845:34)
at D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26815:69
at Object.forEach (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:280:30)
at nodeModuleNameResolverWorker (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26815:25)
at nodeModuleNameResolver (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26808:16)
at Object.resolveModuleName (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26590:30)
at Object.resolveModuleName (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\tsickle\src\googmodule.js:132:29)
at visitImportDeclaration (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\tsickle\src\jsdoc_transformer.js:685:51)

Error: : TypeError: Cannot read property 'directoryExists' of undefined
at Object.directoryProbablyExists (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:12206:22)
at nodeLoadModuleByRelativeName (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26869:25)
at tryResolve (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26845:34)
at D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26815:69
at Object.forEach (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:280:30)
at nodeModuleNameResolverWorker (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26815:25)
at nodeModuleNameResolver (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26808:16)
at Object.resolveModuleName (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26590:30)
at Object.resolveModuleName (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\tsickle\src\googmodule.js:132:29)
at visitImportDeclaration (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\tsickle\src\jsdoc_transformer.js:685:51)

at Object.<anonymous> (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\ng-packagr\lib\ngc\compile-source-files.js:53:68)
at Generator.next (<anonymous>)
at D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\ng-packagr\lib\ngc\compile-source-files.js:7:71
at new Promise (<anonymous>)
at __awaiter (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\ng-packagr\lib\ngc\compile-source-files.js:3:12)
at Object.compileSourceFiles (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\ng-packagr\lib\ngc\compile-source-files.js:19:12)
at Object.<anonymous> (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\ng-packagr\lib\ng-v5\entry-point\ts\compile-ngc.transform.js:26:32)
at Generator.next (<anonymous>)
at D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\ng-packagr\lib\ng-v5\entry-point\ts\compile-ngc.transform.js:7:71
at new Promise (<anonymous>)

An unhandled exception occurred: : TypeError: Cannot read property 'directoryExists' of undefined
at Object.directoryProbablyExists (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:12206:22)
at nodeLoadModuleByRelativeName (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26869:25)
at tryResolve (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26845:34)
at D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26815:69
at Object.forEach (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:280:30)
at nodeModuleNameResolverWorker (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26815:25)
at nodeModuleNameResolver (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26808:16)
at Object.resolveModuleName (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\typescript\lib\typescript.js:26590:30)
at Object.resolveModuleName (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\tsickle\src\googmodule.js:132:29)
at visitImportDeclaration (D:\temp\New folder\xpa4.5\Sources\Webclient\node_modules\tsickle\src\jsdoc_transformer.js:685:51)

@moohkooh
Copy link

+1

@evmar
Copy link
Contributor

evmar commented Jul 29, 2019

I think this is maybe an issue in ngc. I found the related angular/angular#26738 maybe.

If you edit

projects/mscorelib/tsconfig.lib.json:    "annotateForClosureCompiler": true,

and change it to false it will not run tsickle, which will avoid this as well.

@evmar evmar closed this as completed Jul 29, 2019
@mariohmol
Copy link

Hi.. i'm having the same issue https://travis-ci.com/jsGanttImproved/ng-gantt/builds/121972040

Is it fixed?

@Delagen
Copy link

Delagen commented Aug 5, 2019

@mariohtmol it fixed in compiler-cli by adding moduleResolutionHost as I know
angular/angular@6ece7db#diff-3153093ed4c8893b1a1c791b9ad85813R109

@mariohmol
Copy link

Thanks! could make it work upgrading to latest ngpackagr and tsickle.

@sagar-beep
Copy link

@evmar..thanks its worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants