0

I'm trying to use carto-VL on a local instalation via docker. Everything works fine with carto.js v4 and airship, but when i try to use carto-vl it always gives errors and I can't access my datasets, here's what i'm doing:

carto.setDefaultConfig({
   serverURL: 'http://localhost/user/dev'
});

And it gives me this error

enter image description here

I've used the same code here just changing the default config, i've tried to input as other thread sugested, but it gives me the same problem.

    const source = new carto.source.SQL(`select * from cordoba_catastro_simple where year > 1900 and year < 2018`, {
    user: 'dev',
    apiKey: 'default_public'
  }, {
    serverURL: 'http://localhost/user/dev'
  });

is there anything I can do to fix this?

edit: I've tried to put the 8181 port on the serverURL but it gives the same error and the default auth is already set

Edit2: I've been digging into the carto-vl.js file itself, and found one of the sections that presents the problem

enter image description here

the e variable was supposed to have a stats item inside but it doesn't have it... can someone give me a hint of how to solve this problem?

1

Make sure you're changing not only the default config with setDefaultConfig, but also the default auth settings with setDefaultAuth correctly:

carto.setDefaultAuth({
   username: 'dev',
   apiKey: 'default_public'
});

carto.setDefaultConfig({
   serverURL: 'http://localhost/user/dev'
});

This answer explains also that you may need to set the port in your serverlURL to 8181.

  • using the port 8181 it gives the error net::ERR_CONNECTION_REFUSED – andradegbz Apr 1 at 19:02
  • I had to expose the port on docker, it stoped giving the connection refused error but it keeps giving me the error mentioned in the image above – andradegbz Apr 1 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.