Angular 8 to Angular 9 Migration - angular9

After a successful upgrade of a library from Angular 8 to Angular 9
when I try to build it I get the following error:
Compiling TypeScript sources through ngc
ERROR: Decorator argument must resolve to a string
An unhandled exception occurred: Decorator argument must resolve to a string
any lead on what can cause this error or what does it mean?

The issues happened because some of the components Output property had a name which was an Enum and not a plain string. once I changed all those places to a string, it solved the issue.

Related

Angular/Pug - Can't bind to 'ngforOf' since

This code is throwing exception
Uncaught Error: Template parse errors: Can't bind to 'ngforOf' since
it isn't a known property of 'mat-card'.
1. If 'mat-card' is an Angular component and it has 'ngforOf' input, then verify that it is part of this module.
div
button(mat-raised-button, color='primary', (click)='createMocked()') Create Mocked
div
mat-card.Class(*ngfor="let room of rooms; let classroomIndex = index; trackBy: trackClass")
if I will add quotes then I'm missing support from Intellij
Does anyone have idea how to fix 1 and 2 or have woking in intellij reference that I can check?
I used this article: https://medium.com/#MarkPieszak/using-pug-or-jade-templates-with-the-angular-cli-9e37334db5bc
The error
Template parse errors: Can't bind to 'ngforOf' since it isn't a known
property
means that Angular template parser tries to find a directive based on your ngforof attribute but it can't since Angular template syntax is case-sensitive.
You have to write *ngFor= so it will converted to ngForOf and Angular will be able to find dedicated ngForOf directive.
If you're curious how Angular transforms structural directives into ng-template syntax then check this out:
https://alexzuza.github.io/ng-structural-directive-expander/

how to find "illegal literal map"

I am in the process of migrating an application to Angular 6 from Angular 5. at this point I believe I have most issues sorted out and when building with ng serve or ng build main it builds as expected. however when building as ng build --prod main I get the below error
ERROR in : Error: Illegal State: literal maps should have been converted into functions
at _AstToIrVisitor.visitLiteralMap (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:15824:19)
at LiteralMap.visit (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:3483:28)
at ASTWithSource.visit (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:3598:29)
at convertPropertyBinding (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:15626:52)
at createHostBindingsFunction (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:20068:39)
at baseDirectiveFields (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:19754:43)
at compileComponentFromMetadata (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:19793:29)
at compileComponentFromRender2 (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:19878:19)
at /workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:21551:21
at Array.forEach (<anonymous>)
at AotCompiler._compilePartialModule (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:21527:24)
at /workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:21509:58
at Array.forEach (<anonymous>)
at AotCompiler.emitAllPartialModules (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:21509:19)
at AngularCompilerProgram._emitRender3 (/workspace/tarnished-lamp/node_modules/#angular/compiler-cli/src/transformers/program.js:252:41)
at AngularCompilerProgram.emit (/workspace/tarnished-lamp/node_modules/#angular/compiler-cli/src/transformers/program.js:235:59)
I have two questions from this
What does this Error actually mean
How do I find it and correct it
Migrating from angular 6.0 to 7.0, I enabled ivy compiler and I got the same error.
Disabling ivy option, AOT build works again.

Binding using FFImageLoading.Cross.MvxCachedImageView in iOS

I'm using FFImageLoading.Cross.MvxCachedImageView and trying to make conditional binding in iOS, but it fails with the following Mvx trace:
Problem seen during binding execution for binding Image for MvxValueConverterValueCombiner combiner-operation - problem ArgumentException: Object of type 'System.String' cannot be converted to type 'UIKit.UIImage'.
Does anyone know what could be wrong?
set.Bind(imgInfo)
.For(x => x.DataLocationUri)
.OneWay()
.SourceDescribed(#"If(IsFake, 'res:ic_lock_open_white', 'res:ic_info_outline_white')");

InvalidCastException error for Naudio's MMDeviceEnumerator

Whenever I try to create a new MMDeviceEnumerator I get an error
MMDeviceEnumerator DevEnum = new MMDeviceEnumerator();
gives me
An unhandled exception of type 'System.InvalidCastException' occurred in NAudio.dll
Additional information: Unable to cast object of type 'MMDeviceEnumerator' to type 'NAudio.CoreAudioApi.Interfaces.MMDeviceEnumeratorComObject'.
I'm using VS Community 2015, Naudio 1.7.3, on Windows 7 64 bit. Does anyone have a solution to this? NAudio's Midi API seems to work fine.

Dart confusing TYPE error

I am building a web application using dart with web_ui.
Everything was working fine until i added the web_ui pub, and now, when I am trying to run a build.dart file I get an error:
Uncaught Error: type 'AttributeName' is not a subtype of type 'String' of 'name'.
What does this mean?
From what I understand, this means there is somewhere an instance named 'name' of class 'AttributeName' that is extending 'String' class.
I searched my entire project and there is nowhere a class named 'AttributeName', nowhere an instance of 'name'.
I have the latest Dart editor and SDK:
Dart Editor version 0.4.7_r21658
Dart SDK version 0.4.7.5_r21658
EDIT:
this is my build.dart file:
import 'package:web_ui/component_build.dart';
import 'dart:io';
void main() {
build(new Options().arguments, ['web/menyplattan.html']);
}
Also, i updated all the pubs
This message looks like web_ui is failing a type check.
The similar SO question MarioP links to has a stacktrace showing this message coming from within the web ui library itself.
Do you have an xmlns attribute in your html?
Have a look at this web-ui issue.
AttributeName is defined within the html5lib library. Perhaps web-ui is expecting a newer version of this library but getting an older one. Make sure you've done a pub install. You can also try deleting your packages folder and doing a fresh pub install.
This could be caused by out-of-date packages, but it could also be a bug in web-ui. See if you can get a stacktrace and file a bug report, or post it on the web-ui mailing list.