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

Exception while rendering: this.binders[l].setUniform is not a function #9468

Closed
msbarry opened this issue Mar 26, 2020 · 4 comments
Closed
Labels

Comments

@msbarry
Copy link
Contributor

msbarry commented Mar 26, 2020

I upgraded from v1.7.0 to 1.8.1, but had to roll back because of elevated exceptions across all browsers that looked like:

this.binders[l].setUniform is not a function TypeError: this.binders[l].setUniform is not a function
   at SourceExpressionBinder.setUniforms (src/data/program_configuration.js:519)
   at Program.draw (src/render/program.js:135)
   at drawSymbolElements (src/render/draw_symbols.js:389)
   at drawLayerSymbols (src/render/draw_symbols.js:378)
   at drawSymbols (src/render/draw_symbols.js:74)
   at Painter.renderLayer (src/render/painter.js:495)
   at Painter.render (src/render/painter.js:453)
   at Map._render (src/ui/map.js:2195)
   at Map.triggerRepaint (src/ui/map.js:2317)

I can only see that these exceptions started getting thrown, but I do not know exactly what triggers them or if they result in any incorrect behavior.

mapbox-gl-js version: 1.8.1

browser: Chrome (Mac, Windows, Linux, Android), Safari (iOS, Mac), Edge, IE11

Steps to Trigger Behavior: unknown

@msbarry
Copy link
Contributor Author

msbarry commented Mar 26, 2020

Sorry I don't have too much detail here, hopefully this is easy to track down as it looks like @mourner made a recent change in this area (d85afad) - let me know if you need more details and I can do some more testing.

@asheemmamoowala
Copy link
Contributor

@msbarry Can you provide a minimal test case that can reproduce this. We aren't seeing any other reports of this issue. Knowing what triggers it would speed up a fix.

@msbarry
Copy link
Contributor Author

msbarry commented Apr 2, 2020

@asheemmamoowala this appears to trigger it with 1.9.0:

var map = window.map = new mapboxgl.Map({
    container: 'map',
    zoom: 14.13,
    center: [-77.03191, 38.88825],
    style: 'mapbox://styles/mapbox/streets-v10',
    hash: true
});

map.on('load', () => {
    map.setPaintProperty('poi-parks-scalerank1', 'text-color', ["match", ["get", "type"], "Park", "red", "black"]);
});

looks like in this function:

    setUniforms<Properties: Object>(context: Context, binderUniforms: Array<BinderUniform>, properties: PossiblyEvaluated<Properties>, globals: GlobalProperties) {
        // Uniform state bindings are owned by the Program, but we set them
        // from within the ProgramConfiguraton's binder members.
        for (const {name, property, binding} of binderUniforms) {
            (this.binders[property]: any).setUniform(binding, globals, properties.get(property), name);
        }
    }

name is "u_fill_color", property is "text-color" and this.binders['text-color'] is an instance of SourceExpressionBinder which doesn't appear to have a setUniform method

@arindam1993
Copy link
Contributor

Thanks for the detailed repro @msbarry. It was super helpful in figuring out the fix! Its going out withe the 1.9.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants