angular/ngcc-validation

angular-froala-wysiwyg - failure

petebacondarwin opened this issue · 9 comments

Here is the stack trace from the failure to compile this library.

I think we need to change findExportedNameOfNode() to use a ReflectionHost to interact with the source code. Currently it is assuming the source is TS. See https://github.com/angular/angular/blob/a8d84660e5088f0dca1845e24a0422fed080aa81/packages/compiler-cli/src/ngtsc/imports/src/find_export.ts#L14

Compiling angular-froala-wysiwyg : module as esm5
Error: Failed to find exported name of node (function FroalaEditorModule() {
    }) in '/Users/pete/dev/angular/ngcc-validation/angular-froala-wysiwyg-ngcc/node_modules/angular-froala-wysiwyg/editor/editor.module.js'.
    at Object.findExportedNameOfNode (/Users/pete/dev/angular/ngcc-validation/angular-froala-wysiwyg-ngcc/node_modules/@angular/compiler-cli/src/ngtsc/imports/src/find_export.js:33:19)
    at LogicalProjectStrategy.emit (/Users/pete/dev/angular/ngcc-validation/angular-froala-wysiwyg-ngcc/node_modules/@angular/compiler-cli/src/ngtsc/imports/src/emitter.js:194:38)
    at ReferenceEmitter.emit (/Users/pete/dev/angular/ngcc-validation/angular-froala-wysiwyg-ngcc/node_modules/@angular/compiler-cli/src/ngtsc/imports/src/emitter.js:41:44)
    at Object.toR3Reference (/Users/pete/dev/angular/ngcc-validation/angular-froala-wysiwyg-ngcc/node_modules/@angular/compiler-cli/src/ngtsc/annotations/src/util.js:137:32)
    at NgModuleDecoratorHandler._toR3Reference (/Users/pete/dev/angular/ngcc-validation/angular-froala-wysiwyg-ngcc/node_modules/@angular/compiler-cli/src/ngtsc/annotations/src/ng_module.js:287:31)
    at /Users/pete/dev/angular/ngcc-validation/angular-froala-wysiwyg-ngcc/node_modules/@angular/compiler-cli/src/ngtsc/annotations/src/ng_module.js:132:72
    at Array.map (<anonymous>)
    at NgModuleDecoratorHandler.analyze (/Users/pete/dev/angular/ngcc-validation/angular-froala-wysiwyg-ngcc/node_modules/@angular/compiler-cli/src/ngtsc/annotations/src/ng_module.js:132:38)
    at Object.analyzeDecorators (/Users/pete/dev/angular/ngcc-validation/angular-froala-wysiwyg-ngcc/node_modules/@angular/compiler-cli/ngcc/src/analysis/util.js:73:34)
    at DecorationAnalyzer.analyzeClass (/Users/pete/dev/angular/ngcc-validation/angular-froala-wysiwyg-ngcc/node_modules/@angular/compiler-cli/ngcc/src/analysis/decoration_analyzer.js:126:27)

Probably same issue for angular-font-awesome and angularx-social-login-ngcc.

For angular-froala-wysiwyg these links can be useful:

I tried applying this fix from @alxhub alxhub/angular@a5696f9 but this did not solve the problem...

It resulted in the following error message:

ERROR in Cannot read property 'moduleName' of undefined

(also for angularx-social-login)

Looks like a bug inEsm5ReflectionHost.getDeclarationOfIdentifier() for this particular shape.

Now the failure for this package is the classic "Importing removed Renderer".

That's great! I can open a PR to then tomorrow/Monday.

This is now fixed and compiles successfully.