Skip to content

Sample runtime failure Could not find 'azureMapsControl.Core.addMap' ('azureMapsControl' was undefined). #88

Open

Description

@DavidThielen

I've got the sample compiling and running. But on starting up it throws:

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:7159/_framework/blazor.web.js:1:734
    at Array.forEach (<anonymous>)
    at l.findFunction (https://localhost:7159/_framework/blazor.web.js:1:702)
    at b (https://localhost:7159/_framework/blazor.web.js:1:5445)
    at https://localhost:7159/_framework/blazor.web.js:1:3238
    at new Promise (<anonymous>)
    at y.beginInvokeJSFromDotNet (https://localhost:7159/_framework/blazor.web.js:1:3201)
    at fn._invokeClientMethod (https://localhost:7159/_framework/blazor.web.js:1:62541)
    at fn._processIncomingData (https://localhost:7159/_framework/blazor.web.js:1:60016)
    at connection.onreceive (https://localhost:7159/_framework/blazor.web.js:1:53657)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
   at AzureMapsControl.Components.Runtime.MapJsRuntime.InvokeVoidAsync(String identifier, Object[] args) in C:\Git\AzureMapsControl.Components\src\AzureMapsControl.Components\Runtime\MapJsRuntime.cs:line 22
   at AzureMapsControl.Components.Map.AzureMap.OnAfterRenderAsync(Boolean firstRender) in C:\Git\AzureMapsControl.Components\src\AzureMapsControl.Components\Map\AzureMap.razor:line 429
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'MHbG-8tBm6VHLQaXUuHZm7aiZLgpGXhbD-f5DfYwShs'.

And this may be related. Visual Studio will not let me set a breakpoint in AppMap.razor. I can put it in MapJsRuntime which it calls. And on that break it shows AppMap.razor in the call stack. But can't set a breakpoint there.

Anyways, with this error, while the app runs, there's no map.

Activity

  1. arnaudleclerc commented on Feb 28, 2024

    @arnaudleclerc
    Owner

    Looks like you are missing the javascript component. My first would be that you only built the dotnet library itself, but not the typescript part. Can you please run npm run build and check if it makes any difference ?

    Feel free to take a look at the development guidelines : https://github.com/arnaudleclerc/AzureMapsControl.Components/blob/develop/CONTRIBUTING.md#build-the-library

  2. DavidThielen commented on Feb 28, 2024

    @DavidThielen
    Author

    Hi @arnaudleclerc

    I had run the steps in the doc but not npm run build. I ran that too and it was successful, but still the same error. Any other ideas?

    I am running from Visual Studio.

    thanks - dave

  3. marco-manfroni commented on Apr 3, 2024

    @marco-manfroni

    Hi @arnaudleclerc

    I had run the steps in the doc but not npm run build. I ran that too and it was successful, but still the same error. Any other ideas?

    I am running from Visual Studio.

    thanks - dave

    Hi, same error for me. I'm able to create the azure-maps-control.js library using npm and reference it inside the AzureMapsControl.Sample, but the sample project doesnt run.
    I tried with the 1.15.0 build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions