Select to view content in your preferred language

Error in console because of timing issue when loading message bundles

224
1
3 weeks ago
SebastianVogel
New Contributor

We are using ArcGis-Javascript Maps SDK for a project with typescript but without a major framework like Angular or React. We build and bundle everything using vite and in tests and production builds everything works fine but when we are serving the arcgis sources via the vite-dev-server the following error is constantly logged "Error: 'No loader found for message bundle "esri/widgets/Attribution/t9n/Attribution"'" "intl:no-message-bundle-loader".

In the HTML we render this code to 

<arcgis-map id="arcgis-map1" class="h-100 w-100" basemap="osm">
    <arcgis-zoom position="top-right"></arcgis-zoom>
    <arcgis-fullscreen position="top-right"></arcgis-fullscreen>
</arcgis-map>

And then in the map.ts file we import all the necessary components:

import config from "@arcgis/core/config";

import "@arcgis/map-components/components/arcgis-map";
import "@arcgis/map-components/components/arcgis-zoom";
import "@arcgis/map-components/components/arcgis-fullscreen";
config.portalUrl = 'https://customer-portal-url';

 Maybe we did something wrong here but it seems there is a timing issue: I stepped through the whole code and it seems like the zoom and Attributions widgets both call fetchMessageBundle() in @ArcGIS/core/intl/messages.js before registerMessageBundleLoader() was called for the default messageBundleLoader in the  @ArcGIS/core/intl.js module file (with location "https://js.arcgis.com/4.33/@arcgis/core/assets"). Is there a way to fix this?

0 Kudos
1 Reply
AndyGup
Esri Regular Contributor

It's hard to tell without a repro example. These errors can often show up when using local assets that haven't been configured. Take a look at this doc and see if any of the info helps: https://developers.arcgis.com/javascript/latest/working-with-assets/#copy-and-point-to-local-assets, for example be sure to configure the assets path.

For more info on minimal repro apps: https://developers.arcgis.com/javascript/latest/troubleshooting/#minimal-reproducible-application

0 Kudos