Deck.gl: Warning "deck: Missing character: X"

Created on 15 Jan 2019  路  7Comments  路  Source: visgl/deck.gl

Description

Chrome shows warning "deck: Missing character: X"
This is repeated for each character (X) in the word assigned to a TextLayer
Seemed to have been reported in issue #2070 but not resolved

App is Angular
Works without issue in dev environment, behaviour only shows in production
Also have mapbox gl but not using experimental mapbox layers

Repro Steps

Use TextLayer with Angular, deploy to prod
We can't seem to figure out why it works in dev but not prod

Have tried giving the text static text vs coming from datasource and it doesn't help.

Environment (please complete the following information):

  • deck.gl/core 6.3.4 and deck.gl/layers 6.3.4 (same behaviour on 6.3.2 and 6.3.3)
  • Browser Version: Chrome Version 71.0.3578.98 (Official Build) (64-bit) (same on Edge browser)
  • OS: Windows 10, same on MacOS

Logs

deck: deck.gl 6.3.4 - set deck.log.priority=1 (or higher) to trace attribute updates
2.3329c631dedb3844778f.js:1 luma: luma.gl 6.3.2 - set luma.log.priority=1 (or higher) to trace rendering
2.3329c631dedb3844778f.js:1 luma.gl: WebGL debug support imported
2.3329c631dedb3844778f.js:1 luma: WebGL2 context (Google Inc.,ANGLE (Intel(R) UHD Graphics 620 Direct3D11 vs_5_0 ps_5_0))
2.3329c631dedb3844778f.js:1 deck: t.componentName not specified
13.fa6d75053c5f3958aa9c.js:1 deck: Missing character: c
(anonymous) @ 13.fa6d75053c5f3958aa9c.js:1
13.fa6d75053c5f3958aa9c.js:1 deck: Missing character: o
(anonymous) @ 13.fa6d75053c5f3958aa9c.js:1
13.fa6d75053c5f3958aa9c.js:1 deck: Missing character: l
(anonymous) @ 13.fa6d75053c5f3958aa9c.js:1
13.fa6d75053c5f3958aa9c.js:1 deck: Missing character: i
(anonymous) @ 13.fa6d75053c5f3958aa9c.js:1
13.fa6d75053c5f3958aa9c.js:1 deck: Missing character: d

Code in minified JS is
image

bug

Most helpful comment

The default is generated here: https://github.com/uber/deck.gl/blob/6.3-release/modules/layers/src/text-layer/font-atlas.js#L15

My guess is that the minifier optimized it away somehow. I can wrap the for loop in a function to safe guard it.

All 7 comments

You need to supply the characterSet prop if you want to use anything outside of the basic ascii characters.

Just using standard a-z, it only does this when Angular builds and minifies the library, works fine if you don鈥檛. I will try specify the the characterSet to see if that solves it after Angular build thanks.

Is there a way for us to reproduce this behavior of the minifier?

You would need to use the TextLayer in an angular project, then do a build of the project for production, this includes minifying any libraries. Only when that happens did we have issues. The good news is that I've done what you mentioned, I've explicitly included the characterSet which includes ascii 32 through 128 (standard range) and this has resolved the issue for us. So now standard characters like a-z show up without the error.

The default is generated here: https://github.com/uber/deck.gl/blob/6.3-release/modules/layers/src/text-layer/font-atlas.js#L15

My guess is that the minifier optimized it away somehow. I can wrap the for loop in a function to safe guard it.

Try 6.3.9

Awesome thanks! I can confirm 6.3.9 works without me needing to specify the characterSet now.

Was this page helpful?
0 / 5 - 0 ratings