Error: Could not find 'azureMapsControl.Core.addMap on all versions greater than 1.16.1 (Preview V2 versions)
Describe the bug If I upgrade my .NET 9 blazor app to use any version higher than 1.16.1 I get this error message in the browser console.
Error: Microsoft.JSInterop.JSException: Could not find 'azureMapsControl.Core.addMap' ('azureMapsControl' was undefined).
Error: Could not find 'azureMapsControl.Core.addMap' ('azureMapsControl' was undefined).
at https://localhost:7177/_framework/blazor.web.js:1:384
at Array.forEach (
To Reproduce Upgrade to any version higher than 1.16.1 and run the app
Expected behavior Upgrading should not cause the error.
Screenshots
Desktop (please complete the following information):
- OS: Windows 11
- Browser: Edge, Version 131.0.2903.112
Additional context I could not see any difference in the readme for the scripts I was already using for 1.16.1 - is the readme up to date for script versions?
Thanks for opening the issue. I am aware the current preview versions of the V2 are not functional because the scripts are not included within the nugget package anymore. I don't really understand why so far. In the meantime, the preview versions of V2 don't bring anything new compared to the V1 so far, so I would recommend sticking with the V1 for now.
Ok, thanks
fwiw, I cloned the 1.16.1 and latest preview version to compare. What I found was that in Visual Studio this typescript line showed no errors in 1.16.1 but showed errors in the preview version:
import * as azmaps from 'azure-maps-control';
1.16.1 version:
Preview Version:
Hope this helps.
This issue has now been fixed starting from the v.1.17.1. All future versions should now have the web assets included.