Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue updating to 4.2.0 #415

Open
jewicht opened this issue Mar 20, 2024 · 3 comments
Open

Issue updating to 4.2.0 #415

jewicht opened this issue Mar 20, 2024 · 3 comments

Comments

@jewicht
Copy link

jewicht commented Mar 20, 2024

Hello,

I'm trying to update from 4.1.0 and 4.2.0. The only modifications was to bump Plotly.Blazor in the solution and remove the javascripts in _Layout.cshtml.

I get the following exception:

blazor.server.js:1 [2024-03-20T14:59:50.541Z] Error: Microsoft.JSInterop.JSException: Could not find 'newPlot' ('newPlot' was undefined).
Error: Could not find 'newPlot' ('newPlot' was undefined).
    at http://localhost:5123/_framework/blazor.server.js:1:734
    at Array.forEach (<anonymous>)
    at l.findFunction (http://localhost:5123/_framework/blazor.server.js:1:702)
    at _ (http://localhost:5123/_framework/blazor.server.js:1:5445)
    at http://localhost:5123/_framework/blazor.server.js:1:3238
    at new Promise (<anonymous>)
    at y.beginInvokeJSFromDotNet (http://localhost:5123/_framework/blazor.server.js:1:3201)
    at Xt._invokeClientMethod (http://localhost:5123/_framework/blazor.server.js:1:61001)
    at Xt._processIncomingData (http://localhost:5123/_framework/blazor.server.js:1:58476)
    at Xt.connection.onreceive (http://localhost:5123/_framework/blazor.server.js:1:52117)
   at Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeVoidAsync(IJSObjectReference jsObjectReference, String identifier, CancellationToken cancellationToken, Object[] args)
   at Plotly.Blazor.PlotlyJsInterop.NewPlot(CancellationToken cancellationToken)
   at Plotly.Blazor.PlotlyChart.NewPlot(CancellationToken cancellationToken)
   at Plotly.Blazor.PlotlyChart.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Any idea why this newPlot function is not found?

@sean-mcl
Copy link
Collaborator

Yeah, its the browser cache. The examples are using the previous version and overwrite the newest version everytime.
Will update the examples sooner or later. You may want to use the examples using a different browser or a private window.

Use the browser dev tools (Network > Disable Cache)

@jewicht
Copy link
Author

jewicht commented Mar 20, 2024

Thanks, that indeed fixes the issue.

@jewicht
Copy link
Author

jewicht commented Jun 4, 2024

I'm still having the problem with 4.3.0. Clearing the browser cache does the trick but I don't want to inform all the users of my app to clear their cache. so we're still on 4.1.0. How to properly fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants