Getting a syntax error for an ios code in Nativescript - nativescript

Getting a syntax error on the following ios specific code in Nativescript 6.x
navigationBar.standardAppearance.titleTextAttributes =
NSDictionary.dictionaryWithDictionary({
[NSForegroundColorAttributeName]: UIColor.whiteColor
});
Message
Argument of type '{ [x: string]: UIColor; }' is not assignable to parameter of type 'NSDictionary<unknown, unknown>'.
Type '{ [x: string]: UIColor; }' is missing the following properties from type 'NSDictionary<unknown, unknown>': allKeys, allValues, count, descriptionInStringsFileFormat,
How can this be fixed.

Related

Unexpected keyword argument 'unk_token'

When trying to load this tokenizer I am getting this error but I don't know why it can't take the ink_token strangely. Any ideas?
tokenizer = tokenizers.SentencePieceUnigramTokenizer(unk_token="", eos_token="", pad_token="")
----> 1 tokenizer = tokenizers.SentencePieceUnigramTokenizer(unk_token="", eos_token="", pad_token="")
TypeError: init() got an unexpected keyword argument 'unk_token'

Parse message in CloudWatch Logs Insights

Here are two example messages of the lambda:
WARNING:
Field Value
#ingestionTime 1653987507053
#log XXXXXXX:/aws/lambda/lambda-name
#logStream 2022/05/31/[$LATEST]059106a15343448486b43f8b1168ec64
#message 2022-05-31T08:58:18.293Z b1266ad9-95aa-4c4e-9416-e86409f6455e WARN error catched and errorHandler configured, handling the error: Error: Error while executing handler: TypeError: Cannot read property 'replace' of undefined
#requestId b1266ad9-95aa-4c4e-9416-e86409f6455e
#timestamp 1653987498296
ERROR:
Field Value
#ingestionTime 1653917638480
#log XXXXXXXX:/aws/lambda/lambda-name
#logStream 2022/05/30/[$LATEST]bf8ba722ecd442dbafeaeeb3e7251024
#message 2022-05-30T13:33:57.406Z 8b5ec77c-fb30-4eb3-bd38-04a10abae403 ERROR Invoke Error {"errorType":"Error","errorMessage":"Error while executing configured error handler: Error: No body found in handler event","stack":["Error: Error while executing configured error handler: Error: No body found in handler event"," at Runtime.<anonymous> (/var/task/index.js:3180:15)"]}
#requestId 8b5ec77c-fb30-4eb3-bd38-04a10abae403
#timestamp 1653917637407
errorMessage
Error while executing configured error handler: Error: No body found in handler event
errorType
Error
stack.0 Error: Error while executing configured error handler: Error: No body found in handler event
stack.1 at Runtime.<anonymous> (/var/task/index.js:3180:15)
Can you help me understand how to set up the query in order to have a table with the following columns and their values:
from #message extract timestamp, requestID, type (WARN or ERROR), errorMessage and if feasible also the name of the lambda from #log and the #logStream.
If we'd look at the documentation on AWS Insights parse method
We can use asterisks * to capture details which for you would be:
fields #timestamp, #message, #log, #logStream, #requestId
| parse #message "* * * *" as timestamp, requestId, type, body
| display #timestamp, #requestId, #log, #logStream, body
If you'd like to also capture the error message try to now parse the body as well:
fields #timestamp, #message, #log, #logStream, #requestId
| parse #message "* * * *" as timestamp, requestId, type, body
| parse body "*,\"errorMessage\":\"*\"*" as startBody, errorMessage, endBody
| display #timestamp, #requestId, #log, #logStream, body, errorMessage
Should work but please feel free to look up any additional information in the AWS documentation, they've made it very thorough👌🏽

How to get file name that causes GraphQLError: Syntax Error: Unterminated string

In our team we sometimes get an GraphQl syntax error, when modifying our schema.
However, we don't seem to get the name of file causing the issue? The error looks like this:
GraphQLError: Syntax Error: Unterminated string.
at syntaxError (<full-path-to-project>>node_modules/graphql/error/syntaxError.js:15:10)
at readString (<full-path-to-project>>node_modules/graphql/language/lexer.js:513:38)
at readToken (<full-path-to-project>>node_modules/graphql/language/lexer.js:267:14)
at Object.lookahead (<full-path-to-project>>node_modules/graphql/language/lexer.js:54:43)
at Object.advanceLexer [as advance] (<full-path-to-project>>node_modules/graphql/language/lexer.js:44:33)
at Parser.parseStringLiteral (<full-path-to-project>>node_modules/graphql/language/parser.js:519:17)
at Parser.parseDescription (<full-path-to-project>>node_modules/graphql/language/parser.js:728:19)
at Parser.parseFieldDefinition (<full-path-to-project>>node_modules/graphql/language/parser.js:856:28)
at Parser.optionalMany (<full-path-to-project>>node_modules/graphql/language/parser.js:1497:28)
at Parser.parseFieldsDefinition (<full-path-to-project>>node_modules/graphql/language/parser.js:846:17)
at Parser.parseObjectTypeDefinition (<full-path-to-project>>node_modules/graphql/language/parser.js:798:23)
at Parser.parseTypeSystemDefinition (<full-path-to-project>>node_modules/graphql/language/parser.js:696:23)
at Parser.parseDefinition (<full-path-to-project>>node_modules/graphql/language/parser.js:146:23)
at Parser.many (<full-path-to-project>>node_modules/graphql/language/parser.js:1518:26)
at Parser.parseDocument (<full-path-to-project>>node_modules/graphql/language/parser.js:111:25)
at parse (<full-path-to-project>>node_modules/graphql/language/parser.js:36:17) {
message: 'Syntax Error: Unterminated string.',
locations: [ { line: 27, column: 51 } ]
}
Is this normal - and how do I get the file causing the problem?

am I setting the schema wrongly?

am I setting the schema wrongly? I can mutation & Query in playground, but in the frontend hit this error: "Network error: Unexpected token < in JSON at position 0", then I checked in backend, that shows below message, may anyone help me?
# import * from './generated/prisma.graphql'
type Mutation{
createLeague(name: String, zhName: String, image: String, season: String, nation: String, clubs: Club): League!
createClub(name: String, zhName: String, tla: String, badge: String, leagues: League): Club!
}
type Query{
leagues: [League]!
clubs: [Club]!
}
Error: The type of Mutation.createLeague(clubs:) must be Input Type but got: Club.
The type of Mutation.createClub(leagues:) must be Input Type but got: League.
at assertValidSchema (/mnt/c/Users/chisi/coding/tipson0.1/server/node_modules/graphql/type/validate.js:78:11)
at Object.validate (/mnt/c/Users/chisi/coding/tipson0.1/server/node_modules/graphql/validation/validate.js:55:35)
at doRunQuery (/mnt/c/Users/chisi/coding/tipson0.1/server/node_modules/apollo-server-core/dist/runQuery.js:111:42)
at /mnt/c/Users/chisi/coding/tipson0.1/server/node_modules/apollo-server-core/dist/runQuery.js:21:56
at process._tickCallback (internal/process/next_tick.js:68:7)
Error: The type of Mutation.createLeague(clubs:) must be Input Type but got: Club.
The type of Mutation.createClub(leagues:) must be Input Type but got: League.
at assertValidSchema (/mnt/c/Users/chisi/coding/tipson0.1/server/node_modules/graphql/type/validate.js:78:11)
at Object.validate (/mnt/c/Users/chisi/coding/tipson0.1/server/node_modules/graphql/validation/validate.js:55:35)
at doRunQuery (/mnt/c/Users/chisi/coding/tipson0.1/server/node_modules/apollo-server-core/dist/runQuery.js:111:42)
at /mnt/c/Users/chisi/coding/tipson0.1/server/node_modules/apollo-server-core/dist/runQuery.js:21:56
at process._tickCallback (internal/process/next_tick.js:68:7)

fhir-net-api (STU3) - Hl7.Fhir.Model.PlanDefinition parsing error

Using HL7.FHIR.STU3.Core, I am getting an invalid cast exception when I try and parse an PlanDefinition FHIR file.
Do I need to set the Schema for PlanDefinition file?
string HL7FilePath = string.Format("{0}\\{1}", System.IO.Directory.GetCurrentDirectory(), "ANA3.xml");
string HL7FileData = File.ReadAllText(HL7FilePath)
var b = new FhirXmlParser().Parse<Bundle>(HL7FileData);
Error
InValidCastException {"Unable to cast object of type 'Hl7.Fhir.Model.PlanDefinition' to type 'Hl7.Fhir.Model.Bundle'."}
You are trying to parse a PlanDefinition resource into a Bundle object, as the InvalidCastException tells you. If you change the Parse<Bundle> into Parse<PlanDefinition> your code should work fine.

Resources