question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'type' does not exist in type 'SymbolProperties'

See original GitHub issue

I am reporting an issue with

  • TypeScript definitions
  • another resource in this repository

I’m getting a type error with Graphic. I’ve cloned this repo and added Graphic to the app.component.ts. When I add the following code I get a compilation error from Visual Studio Code “Type ‘{ type: string; color: number[]; outline: null; }’ is not assignable to type ‘SymbolProperties’. Object literal may only specify known properties, and ‘type’ does not exist in type ‘SymbolProperties’.ts(2322)”

const extentGraphic = new Graphic({ geometry: null, symbol: { type: 'simple-fill', color: [0, 0, 0, 0.5], outline: null } });

The symbol property on Graphic should autocast to Symbol. Type is a valid property on symbol. https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html#properties-summary Is there an error in the 4.18 api or is there some sort of typescript error?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jkieboomcommented, Jan 11, 2021

We recently worked on support for this type of auto-casting in the typings, it should become available in the 4.19 (March) release.

1reaction
andygupcommented, May 21, 2021

Hi @overcash597 that is correct, and thanks for everyone’s patience on this. This issue is related to functionality that finally made it into TypeScript 4.3, and it just became a release candidate on May 12. Since we still need to verify this functionality and wait for TypeScript 4.3 to become final, we don’t expect this to make the 4.20 release which is tentatively planned for the end of June.

In the meantime, in order to get your build to work you will need initialize new SimpleFillSymbol(), new SimpleLineSymbol() and new Color(). You’ll have to extract all autocasted Classes and initialize them separately.

The 4.20 doc is also being updated to reflect this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting error while implementing the Graphic function in Angular
Object literal may only specify known properties, and 'type' does not exist in type 'SymbolProperties'. The application is running on the ...
Read more >
TypeScript: Property does not exist on type '{}' - Stack Overflow
In the ts file I'm getting an error as follows: Property 'fadeDiv' does not exist on type '{}'. I think I have the...
Read more >
Fix - Property does not exist on type '{}' in TypeScript
The error property does not exist on type '{}' in TypeScript occurs when you access non existing object property and it can be...
Read more >
Property 'description' does not exist on type 'unique symbol'
Property 'description' does not exist on type 'unique symbol' #38310 ; Bug A bug in TypeScript ; ES2019 Relates to the ES2019 Spec...
Read more >
Documentation - Everyday Types - TypeScript
In this chapter, we'll cover some of the most common types of values you'll find in JavaScript code, and explain the corresponding ways...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found