Im trying to put mapbox working on a spfx webpart. But having trouble with it when deploying the webpart to App Catalog On gulp serve, it works ok
but when deployed to App Catalog it renders like this
It shows up a warning on console, that the .css was not loaded, and I can see that is not present on Network tab.
Im loading the css like this
protected onInit(): Promise<void> {
SPComponentLoader.loadCss('https://api.tiles.mapbox.com/mapbox-gl-js/v0.46.0/mapbox-gl.css');
return super.onInit();
}
Like the example shown here: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/reference-third-party-css-styles
protected onInit(): Promise<void> { SPComponentLoader.loadCss('https://api.tiles.mapbox.com/mapbox-gl-js/v0.46.0/mapbox-gl.css'); return super.onInit(); }