-
Notifications
You must be signed in to change notification settings - Fork 658
tileserver-gl-light is broken. maplibregl missing since version 5.2.0 #1488
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
Comments
Are you using the docker release or just straight through npm? In 5.20 all the libraries we changed to be installed as part of prepare #1427 , so those js files are supposed to get copied to the public/resources as part of the npm install |
I tested the docker version of light 5.20 and it seemed to work as expected. |
Running directly from npm on Windows like this: btw my current Node is v23.6.1 |
If you use node v22 does it make a difference? In maplibre-native we only publish binaries for even LTS releases right now, so node v23 would not be supported. |
Tried with 22 and it's the same as with 23 |
I think the issue is the publish.js script is removing the 'prepare' section of the the package.json in https://github.com/maptiler/tileserver-gl/blob/master/publish.js#L40 We need this line now though, because it copies over the all the js files When I install light globally I can see that line doesn't exist @okimiko do you agree? |
Can you test this as a workaround? 1.) Open a command prompt to your tileserver-gl v5.20 folder. when I installed globally it ended up in 2.) Install the js files by running 3.) try running tileserver-gl again |
@acalcutt: Yes, I agree: The prepare is responsible for the dependency integration.
|
Like mentioned the new error is unrelated. are you using the default switzerland mbtiles file there? that file is an older version of the schema where aerodrome_label might not exist. if you look at inspect you should see if that layer actually exists, like Usually I only use the built in style and data for testing. It is usually a good idea to get the latest version of the style (like from https://github.com/openmaptiles/osm-bright-gl-style ) and create an update mbtiles file (you can use something like planetiler or the openmaptiles tools (I prefer planetiler myself)) At some point maybe I should ask @klokan for the rights to update tileserver-gl-styles https://www.npmjs.com/package/tileserver-gl-styles , but right now I don't have the permission needed to update it @okimiko would you possibly submit a PR to remove this line https://github.com/maptiler/tileserver-gl/blob/master/publish.js#L40 |
@okimiko The first error comes from the basic preview. @acalcutt I'm using Monaco mbtiles, provided from the outside. With 5.1.3 I'm not getting neither of the errors. |
the reason you don't see an error in inspect is because your style is trying to use a layer that doesn't exist and/or has been renamed. that is why I mention it is always good to update the style (and use a config json file to point to it) . the version of the style included is oudated and there are updates to it at https://github.com/openmaptiles/osm-bright-gl-style/releases that account for the openmaptiles schema changes. Inspect only lists layers in your data sources vector_layers metadata. |
I added the PR for the re-added prepare script. PS: And I could reproduce the 'uncaught promise' error, but only with a explicit node (20.18.1) run (in docker) of the light build, but not with the docker builds (normal and light) ... Strange. |
I tried merging the PR #1489 thats add 'prepare' back into the light version, but it seems 'prepare' is not run when you install a package globally. 'prepare' is supposed to be run before the npm publish, but the files being copied are just not being included in the package because we exclude them in .gitignore It seems like the recommended way to fix that would be to specifically list the files that should be included in the package, which is what I am testing in #1490 . This allows the js files to be included in the npm package. I read you could also use .npmignore, but having both that and .gitignore could lead to confusion and explicitly listing the files was preferred. I think we could also change 'prepare' to 'postinstall'. 'postinstall' does get run when installing a package globally, so it could be an alternative to including the files in the package. |
Can you give tileserver-gl-light v5.2.2-pre.0 a try and tell me if it works better. the js files should now get included in the package |
@DVLP: 5.3.0-pre.0 should fix the rtl issue, which was caused by an version mismatch between maplibre-gl-js and the rtl plugin. |
I don't have full tileserver-gl and I ran a simple example with tileserver-gl-light 5.2.0
Upon opening localhost:8080, getting this
basic-preview/?vector:61 Uncaught ReferenceError: maplibregl is not defined
at basic-preview/?vector:61:7
This line in code
I managed to get it working by downgrading to 5.0.0, then 5.1.3 also worked
Broken version is 5.2.0
Cause: missing maplibregl
This and other errors from the console
The text was updated successfully, but these errors were encountered: