shaigem / BlazorPanzoom

Blazor wrapper for timmywil's panzoom library that helps make zooming and panning of Blazor components and elements easier
https://shaigem.github.io/BlazorPanzoom/
MIT License
47 stars 13 forks source link

Issue with Net 6.0 #10

Closed jlbspace closed 2 years ago

jlbspace commented 2 years ago

Hi Using your sample code with .net 6, I get the follow exception, can help me please!

aspnetcore-browser-refresh.js:234

   **WebSocket connection to 'wss://localhost:63623/Web.Server/' failed: Error in connection establishment:** net::ERR_CONNECTION_RESET

(anónimo) @ aspnetcore-browser-refresh.js:234 getWebSocket @ aspnetcore-browser-refresh.js:231 (anónimo) @ aspnetcore-browser-refresh.js:15 blazor.webassembly.js:1

   crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
  Unhandled exception rendering component: Could not find 'blazorPanzoom.createPanzoomForReference' ('blazorPanzoom' was undefined).
  Error: Could not find 'blazorPanzoom.createPanzoomForReference' ('blazorPanzoom' was undefined).
      at https://localhost:44339/_framework/blazor.webassembly.js:1:328
      at Array.forEach (<anonymous>)
      at a.findFunction (https://localhost:44339/_framework/blazor.webassembly.js:1:296)
      at _ (https://localhost:44339/_framework/blazor.webassembly.js:1:2437)
      at https://localhost:44339/_framework/blazor.webassembly.js:1:3325
      at new Promise (<anonymous>)
      at Object.beginInvokeJSFromDotNet (https://localhost:44339/_framework/blazor.webassembly.js:1:3306)
      at Object.St [as invokeJSFromDotNet] (https://localhost:44339/_framework/blazor.webassembly.js:1:59849)
      at _mono_wasm_invoke_js_blazor (https://localhost:44339/_framework/dotnet.6.0.2-mauipre.1.22102.15.kf8l5pkaed.js:1:194973)
      at wasm://wasm/00970ba6:wasm-function[219]:0x1a129

Microsoft.JSInterop.JSException: Could not find 'blazorPanzoom.createPanzoomForReference' ('blazorPanzoom' was undefined). Error: Could not find 'blazorPanzoom.createPanzoomForReference' ('blazorPanzoom' was undefined). at https://localhost:44339/_framework/blazor.webassembly.js:1:328 at Array.forEach () at a.findFunction (https://localhost:44339/_framework/blazor.webassembly.js:1:296) at _ (https://localhost:44339/_framework/blazor.webassembly.js:1:2437) at https://localhost:44339/_framework/blazor.webassembly.js:1:3325 at new Promise () at Object.beginInvokeJSFromDotNet (https://localhost:44339/_framework/blazor.webassembly.js:1:3306) at Object.St [as invokeJSFromDotNet] (https://localhost:44339/_framework/blazor.webassembly.js:1:59849) at _mono_wasm_invoke_js_blazor (https://localhost:44339/_framework/dotnet.6.0.2-mauipre.1.22102.15.kf8l5pkaed.js:1:194973) at wasm://wasm/00970ba6:wasm-function[219]:0x1a129 at Microsoft.JSInterop.JSRuntime.d16`1[[Microsoft.JSInterop.IJSObjectReference, Microsoft.JSInterop, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() at BlazorPanzoom.JSBlazorPanzoomInterop.d13`1[[Microsoft.JSInterop.IJSObjectReference, Microsoft.JSInterop, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() at BlazorPanzoom.JSBlazorPanzoomInterop.CreatePanzoomAsync(ElementReference elementReference, PanzoomOptions options) at BlazorPanzoom.PanzoomHelper.CreateForElementReferenceAsync(ElementReference elementReference, PanzoomOptions panzoomOptions) at BlazorPanzoom.Panzoom.OnAfterRenderAsync(Boolean firstRender) at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

jlbspace commented 2 years ago

I just update the project to version .net 6 and now works fine!

jlbspace commented 2 years ago

Now works fine!