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

Mapbox owned VT throws "Expected varint not more than 10 bytes." #13118

Closed
Bernoulli-IT opened this issue Mar 18, 2024 · 2 comments
Closed

Mapbox owned VT throws "Expected varint not more than 10 bytes." #13118

Bernoulli-IT opened this issue Mar 18, 2024 · 2 comments

Comments

@Bernoulli-IT
Copy link

Bernoulli-IT commented Mar 18, 2024

Whenever building an Angular application in development mode Mapbox keeps throwing

"Expected varint not more than 10 bytes. mapbox://mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2"

This is an annoying issue when developing because tiles don't get shown although they come from Mapbox itself. What is causing this and can it be resolved. Is it possible to disable VTValidate in development mode (when creating the map)?

version: 2.15.0

browser: Chrome, Edge

Steps to Trigger Behavior

  1. Angular application with mapbox-gl-js
  2. Default Mapbox streets map style
  3. Build application with {"vendorChunk": true, "extractLicenses": false, "buildOptimizer": false, "sourceMap": true, "optimization": false, "aot": true, "namedChunks": true} (👈🏼 most relevant)
  4. Run application and encounter the exception (dozens of it 😢)

It does seem to be related with starting a debugging session from VS Code. When an "independent" browser is opened and the development application address is navigated to, no issues 🤔

Expected Behavior

A clean presentation of the Mapbox style in the browser application.

Actual Behavior

Dozens of exceptions (errors) being thrown and incomplete map representation. When building a production version all is flawless.

image

@stepankuzmin
Copy link
Contributor

Hi @Bernoulli-IT,

This is most likely caused by transpilation of GL JS. Please consider:

See also #10565

@Bernoulli-IT
Copy link
Author

Bernoulli-IT commented Mar 18, 2024

As the provided options are not easy (or impossible) to implement in an Angular application build with VS Code I just found a way that also resolves the issue. This is by attaching the VS Code debugger to the application instead of launching the application from within VS Code.

  1. Create an attach configuration with VS Code (it defaults to port 9222)
  2. Make sure Chrome is opened with --remote-debugging-port=9222

For a detailed explanation StackOverflow

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

No branches or pull requests

2 participants