Select to view content in your preferred language

498 Invalid Token error with esriConfig.apiKey

45
1
2 hours ago
WebDevelopers
New Member

Hi, 

I am trying to change my TypeScript app that uses the JS SDK version 4.24 to use one of the new API keys, since its previous API Key is now legacy. I haven't changed anything except the API key, and now I get `498 Invalid Token` on every request.

I also tried the advice from this post and used my new API key in the suggested tutorial in the documentation. It doesn't work there either, but my old legacy API key does. 

Any ideas? Thanks in advance.

Tags (1)
0 Kudos
1 Reply
WebDevelopers
New Member

oops forgot to show part of my code

import esriConfig from '@arcgis/core/config';
import Map                          from '@arcgis/core/Map';
import MapView                      from '@arcgis/core/views/MapView';

esriConfig.apiKey = "xyzxy";
//creates the map
const map = new Map({
  basemap: "arcgis-light-gray", // Basemap layer service
});

//creates the MapView
const view = new MapView({
  map: map,
  center: [-98.0932, 38.232], // Longitude, latitude
  zoom: 4, // Zoom level
  container: 'viewDiv', // Div element
  popup: {
      autoOpenEnabled: false
  }
});

 

0 Kudos