prettier: SyntaxError: Only void and foreign elements can be self closed - code-formatting

I get this error when I run prettier.
..\index.component.html
[error] ..\index.component.html: SyntaxError: Only void and foreign elements can be self closed "home-hero" (3:5)
[error] 1 |
[error] 2 | <layout>
[error] > 3 | <home-hero slot="hero" />
[error] | ^
[error] 4 |
[error] 5 | <h3 slot="callout" />
[error] 6 |
But I want to use self close tag. How set prettier to ignore this error?
In prettier schema I don't see any reference of "self" or something like this.

This is actually a feature with HTML standard as mentioned in the below thread -
Are (non-void) self-closing tags valid in HTML5?
All the modern libraries like angular use the HTML5 standard for template in which case the user defined templates will be treated as non-void and hence you have to close the tag with proper ending tag.
Here is the complete list of HTML tag description related to void and non-void
https://developer.mozilla.org/en-US/docs/Web/HTML/Element
You can also check the spec related to tech home-hero is written whether they allow the self closing tags!

Related

Log to Crashlytics with tag and priority without also sending to logcat

There are two ways to log to Crashlytics according to the documentation.
Crashlytics.log(int priority, String tag, String msg);
In addition to writing to the next crash report, it will also write to the LogCat using android.util.Log.println(priority, tag, msg).
Crashlytics.log(msg);
which will only write to the Crashlytics crash report [not logcat].
However, this second method does not allow me to set a tag and priority. Instead it automatically sets the resulting tag as "CrashlyticsCore" and priority to debug:
From Fabric dashboard:
1 | 04:24:55:100 (UTC) | D/CrashlyticsCore ...
2 | 04:24:55:101 (UTC) | D/CrashlyticsCore ...
3 | 04:24:55:121 (UTC) | D/CrashlyticsCore ...
How can I keep my actual tag and debug value? I suppose I could create a custom message but this seems ugly and would just clutter up Fabric:
String output = String.format(Locale.US,
"Priority: %d; %s : %s", priority, tag, message);
Crashlytics.log(output);
If you need to log tags in Crashlytics but avoid them in LogCat using Crashlytics.log(int priority, String tag, String msg); I would recommend to enable SilentLogger for Fabric:
// Create Crashlytics Kit which doesn't trace crashes in debug mode
final Crashlytics crashlyticsKit = new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build();
// Use SilentLogger instead of DefaultLogger to avoid writing into LogCat
Fabric.with(new Fabric.Builder(this).kits(crashlyticsKit).logger(new SilentLogger()).build());

WP Windows Phone Invalid XAML

I get exception
An exception of type 'Windows.UI.Xaml.Markup.XamlParseException'
occurred in WP.MyOffice.exe but was not handled in user code
WinRT information: Unable to resolve property '%1' while processing
properties for Uid '%0'. [Line: 79 Position: 27]
1 - line 79 position 27
2 - "Invalid XAML" in Error List window
In Resources.recw has Hub.Header and HubSection1.Header
How found what is wrong?
Check your resources.resw file, you probably have something like Hub.Text, while the "Hub" element doesn't support that attribute (text). Maybe you already used the key Hub for something else
Strategy to fix:
Remove the x:uid properties and worry about localization later, get the Hub working.
If it still doesn't work create a basic hub with no items. Once working add the hub items/sections back until the point of failure.
Once the failure is determined resolve.

Why does mapping to a List inside lifted query fail with "Slick does not know how to map the given types."?

I am trying to map to a List inside a Slick lifted query, and I get a compilation error:
No matching Shape found.
[error] Slick does not know how to map the given types.
[error] Possible causes: T in Table[T] does not match your * projection. Or you use an unsupported type in a Query (e.g. scala List).
[error] Required level: scala.slick.lifted.FlatShapeLevel
[error] Source type: Seq[String]
[error] Unpacked type: T
[error] Packed type: G
Why is it that in a non-Slick map operation, I can map to any type, whereas in a Slick query, I can map to simple Scala types, but not to a Scala List?
Try to
import slick.driver.(yourDB)Driver.api._

T4MVCVB doesn't work on clean install?

I just installed T4MVCVB and it won't compile:
Error 1 Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration c:\...\T4MVCVB.tt 1 1
Error 2 Compiling transformation: Method must have a return type c:\...\T4MVCVB.tt 1 6
Error 3 Compiling transformation: Type expected c:\...\T4MVCVB.tt 1 12
Note that the line number is 1 for each of these errors, so there's no way at all to see what line it doesn't like.
How can I figure out what the problem is so I can generate typed helpers for VB?
Edit: After some cleanup, now I get the following compiler error, and the line number of the problem:
Error 112 Running transformation: System.NotImplementedException: Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))
at EnvDTE80.CodeFunction2.get_Attributes()
at {long call stack}
The line it doesn't like is:
// Ignore methods that are marked as not being actions
if (GetAttribute(method.Attributes, "System.Web.Mvc.NonActionAttribute") != null)
continue;
Make sure you are using the latest version made for VB. Here is the T4MVCVB Nuget Package
If it's still breaking before generating the .vb files, I would uncomment these two lines near the top of T4MVCVB.tt and see if you can find the problem location.
//System.Diagnostics.Debugger.Launch();
//System.Diagnostics.Debugger.Break();

selenium web driver - support for storeText

Selenium IDE I am trying to store text as variable which I can later compare with the database value.
In Selenium IDE
storeText | product >= 999 | prodVal
In webdriver it shows
// ERROR: Caught exception [Error: locator strategy either id or name must be specified explicitly.]
Is there a workaround for this?
Thanks