Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of undefined (reading 'map') #24

Closed
Tsovak opened this issue Jan 6, 2022 · 3 comments
Closed

Cannot read properties of undefined (reading 'map') #24

Tsovak opened this issue Jan 6, 2022 · 3 comments

Comments

@Tsovak
Copy link
Contributor

Tsovak commented Jan 6, 2022

the map crashed when tried to see the report "Fork of COVID vs Population Density in ".
Couldn't reproduce anymore.

Configuration:

Browser Google Chrome Version 96.0.4664.110 (Official Build) (x86_64)
MacBook Pro with Intell Core i7 / Radeon Pro 555 2 GB / 16Gb

Steps:

Output

image

console log

TypeError: Cannot read properties of undefined (reading 'map')
    at data-table-modal.js:96
    at index.js:67
    at d (defaultMemoize.js:123)
    at index.js:81
    at r.d [as columns] (defaultMemoize.js:123)
    at r.value (data-table-modal.js:176)
    at qa (react-dom.production.min.js:187)
    at Ga (react-dom.production.min.js:186)
    at $s (react-dom.production.min.js:269)
    at Pl (react-dom.production.min.js:250)
w @ message.js:25
onError @ ReportPage.js:198
componentDidCatch @ ReportPage.js:168
i.componentDidCatch.n.callback @ react-dom.production.min.js:217
gi @ react-dom.production.min.js:131
vs @ react-dom.production.min.js:220
Rl @ react-dom.production.min.js:259
t.unstable_runWithPriority @ scheduler.production.min.js:18
Xo @ react-dom.production.min.js:122
kl @ react-dom.production.min.js:252
bl @ react-dom.production.min.js:243
(anonymous) @ react-dom.production.min.js:123
t.unstable_runWithPriority @ scheduler.production.min.js:18
Xo @ react-dom.production.min.js:122
Ko @ react-dom.production.min.js:123
Yo @ react-dom.production.min.js:122
je @ react-dom.production.min.js:292
Kt @ react-dom.production.min.js:73
@delfrrr
Copy link
Contributor

delfrrr commented Jan 11, 2022

Here you go:
Screenshot 2022-01-11 at 07 45 41

https://play.dekart.xyz/reports/de18012a-e1e4-425b-9eae-8450a948ab3e/source

with geometry as (
    SELECT
    (
      SELECT value
      FROM UNNEST(all_tags)
      WHERE key = 'name'
      LIMIT 1
    ) AS name,
    bqcarto.h3.ST_ASH3_POLYFILL(ST_SIMPLIFY(geometry, 1000), 6) as h3_arr
    FROM `bigquery-public-data.geo_openstreetmap.planet_features_multipolygons` AS features
    WHERE
    (
      'ISO3166-1',
      'RU'
    ) IN (
      SELECT (key, value)
      FROM         UNNEST(all_tags)
    )
    AND ('admin_level', '2') IN (
      SELECT (key, value)
      FROM UNNEST(all_tags)
    )
), geometry_hex as (
    select
        h3,
        ST_CENTROID(bqcarto.h3.ST_BOUNDARY(h3)) as point
    FROM geometry
    cross join unnest(h3_arr) as h3
), hexagones as (
    select 
        population,
        h3,
        last_updated
    FROM geometry_hex
        join `bigquery-public-data.worldpop.population_grid_1km` as pop
        on st_intersects(pop.geog, geometry_hex.point)
)
select 
    array_agg(population order by last_updated desc limit 1)[offset(0)] population,
    h3
from hexagones group by h3
  • Given the size of the country I simplified to 1000 meters (6 does not make sense, 100 is too small still)
  • also chose higher level of hexagons; level 6 already gives around 500k points

@Tsovak could please try to reproduce JS error and send a ling to the map 🙏

@NoCoSancho
Copy link

Hello!

I had this same issue. The cause was my mapbox token scope included some secret scopes.

2022-01-21_07-54-02

does your token start with pk.*? Mine did not, and I had to create a new one and ensure not to check any options from the secret scopes section.

2022-01-21_20-29-16

@delfrrr
Copy link
Contributor

delfrrr commented Jan 25, 2022

My mailbox token starts from pk pk.eyJ............PLA it's a default public token; I've tried other public scope token and it worked without errors. You should not use token with private scopes of sure.

@NoCoSancho I also believe this is different problem from one reported by @Tsovak

@Tsovak Tsovak closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants