maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.19k stars 632 forks source link

Cannot find module ' ' when running Docker run for klokantech/tileserver-gl with custom style.json files for mbtiles #491

Open briantran37 opened 3 years ago

briantran37 commented 3 years ago

I go and try to run Docker to serve up tileserver-gl with this command :

docker run --rm -it -v $(pwd):/data -p 8080:80 klokantech/tileserver-gl

I get this error as the server starts up:


Starting Xvfb on display 99
xdpyinfo:  unable to open display ":99".

Starting tileserver-gl v2.6.0
Using specified config file from config.json
Starting server
module.js:478
    throw err;
    ^

Error: Cannot find module '/usr/src/app/node_modules/tileserver-gl-styles/styles/osm-bright/styleTest.json'
    at Function.Module._resolveFilename (module.js:476:15)
    at Function.Module._load (module.js:424:25)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at module.exports (/usr/src/app/src/serve_style.js:16:25)
    at /usr/src/app/src/server.js:114:28
    at Array.forEach (native)
    at start (/usr/src/app/src/server.js:106:36)
    at module.exports (/usr/src/app/src/server.js:425:17)
    at startServer (/usr/src/app/src/main.js:78:29)

I'm finding that it gives this error whenever I pass it any style.json files or directories that i've created recently in the config.json file:

"styles": {
      "klokantech-basic": {
        "style": "klokantech-basic/style.json",
        "tilejson": {
          "type": "overlay",
          "bounds": [
            8.275,
            47.225,
            8.8,
            47.533
          ]
        }
      },

this one is an original style thats been there. but when i try and pass it this

    "styleTest": {
        "style": "osm-bright/styleTest.json",
        "tilejson": {
          "type": "overlay",
          "bounds": [
            8.275,
            47.225,
            8.8,
            47.533
          ]
        }
      },

the server wont start and will throw the error

Not sure how to get it to start the server and serve mbtiles vector tiles with custom styles.

is it just that im styling it wrong? how can I know that?

Mox93 commented 3 years ago

@briantran37, have you been able to figure out how to get it working. If yes, can you share the steps please.