mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Useless error message after failing to load vector map data: Error: Error at Actor.receive (actor.js:81)

Open poidl opened this issue 8 years ago • 2 comments

mapbox-gl-js version: v0.44.2 browser: Chromium Version 66.0.3359.139

Steps to Trigger Behavior

  1. Load the following map (jsbin link below, but I can't verify whether the errors are the same I'm seeing when using a fileserver)
<head>
    <!-- <script src='/script.js'></script> -->
    <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.js'></script>
    <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.css' rel='stylesheet' />
</head>

<body>

    <!-- <div id='mapdiv' style='width: 400px; height: 300px;'></div> -->
    <div id='mapdiv' style='position: absolute; top: 0; bottom: 0; width: 100%' ;></div>

</body>

<script>
    var style = {
        "version": 8,
        "name": "Custom",
        "metadata": {
            "mapbox:autocomposite": true
        },
        "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
        "sources": {
            "composite": {
                "type": "vector",
                "tiles": [
                    "https://mydebugbucket.s3-ap-southeast-1.amazonaws.com/{z}/{x}/{y}.pbf"
                ],
                "minzoom": 4,
                "maxzoom": 5
            }
        },
        "layers": [
            {
                "id": "boundary_low",
                "type": "line",
                "source": "composite",
                "source-layer": "boundary_low",
                "minzoom": 4,
                "maxzoom": 5,
                "paint": {
                    "line-color": "#929293"
                }
            }
        ]
    }
    var options = mapboxgl.Options = {
        container: 'mapdiv',
        style: style,
        center: [-81, 29], // starting position [lng, lat]
        zoom: 4, // starting zoom
        minZoom: 4,
        maxZoom: 15
    }

    var map = new mapboxgl.Map(options)
</script>

Link to Demonstration

http://jsbin.com/coforizelu/edit?html,console,output

Expected Behavior

I expect to see a 404 Not Found error message in the console (just like when raster data is missing)

Actual Behavior

I see

Error: Error
    at Actor.receive (actor.js:81)

in the console. At least when the area displayed on the map is large enough, so that actually some .pbf files are tried to be downloaded that don't exist.

poidl avatar May 09 '18 05:05 poidl

Hi @poidl , thanks for reporting this issue. I believe this was fixed in https://github.com/mapbox/mapbox-gl-js/pull/6126, which is now available in the v0.45.0 release. Changing to 0.45 in the linked JSBin eliminates the console error.

anandthakker avatar May 09 '18 12:05 anandthakker

Oops I missed the new release two days ago;-) Sorry and thanks!

poidl avatar May 09 '18 21:05 poidl