You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was migrating an example application running in v8 of both @deck.gl and @deck.gl/carto to the v9 alpha counterparts, following the current documentation and specs.
This is the basic code powering the application layers:
constpois=vectorQuerySource({
...cartoConfig,sqlQuery: 'SELECT * FROM carto-demo-data.demo_tables.osm_pois_usa'});
newVectorTileLayer({id: 'pois',data: pois,
...
}),
The issue is that the resulting Typescript code can't be compiled into a build version due to the following type error on the data attribute:
Type 'Promise<TilejsonResult>' is not assignable to type '((TilejsonResult | Promise<TilejsonResult> | null) & Promise<TilejsonResult> & URLTemplate) | undefined'.
Type 'Promise<TilejsonResult>' is not assignable to type 'Tilejson & { accessToken: string; } & Promise<TilejsonResult> & string[]'.
Type 'Promise<TilejsonResult>' is missing the following properties from type 'Tilejson': tilejson, name, description, version, and 12 more.ts(2322)
vector-tile-layer.d.ts(9, 5): The expected type comes from property 'data' which is declared here on type 'Partial<Required<_MVTLayerProps> & Required<_VectorTileLayerProps> & { id: "pois"; data: Promise<TilejsonResult>; ... 8 more ...; updateTriggers: { ...; }; } & Required<...> & Required<...> & Required<...>>'
After showing the to @felixpalmer we agreed it looks like a bug around types and that we'd like to double-check it, so I'm opening this issue and hoping for a fix :)
Flavors
Script tag
React
Python/Jupyter notebook
MapboxOverlay
GoogleMapsOverlay
CartoLayer
ArcGIS
Expected Behavior
Types should work just fine passing promises to the data attribute
Description
I was migrating an example application running in v8 of both @deck.gl and @deck.gl/carto to the v9 alpha counterparts, following the current documentation and specs.
This is the basic code powering the application layers:
The issue is that the resulting Typescript code can't be compiled into a build version due to the following type error on the
data
attribute:After showing the to @felixpalmer we agreed it looks like a bug around types and that we'd like to double-check it, so I'm opening this issue and hoping for a fix :)
Flavors
Expected Behavior
Types should work just fine passing promises to the
data
attributeSteps to Reproduce
Here's a Stackblitz project to reproduce the issue: https://stackblitz.com/edit/vitejs-vite-1jnk4p?file=src%2Fmap.ts
Environment
Logs
No response
The text was updated successfully, but these errors were encountered: