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

Unhandled exception rendering component: Vditor is not defined #9

Open
zhoudali87 opened this issue May 20, 2022 · 1 comment
Open

Comments

@zhoudali87
Copy link

Microsoft.JSInterop.JSException: Vditor is not defined
ReferenceError: Vditor is not defined
at Object.preview (https://localhost:5001/_content/Vditor/vditor-blazor.js:67:5)
at https://localhost:5001/_framework/blazor.server.js:1:70055
at new Promise ()
at e.beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.server.js:1:70021)
at https://localhost:5001/_framework/blazor.server.js:1:26303
at Array.forEach ()
at e.invokeClientMethod (https://localhost:5001/_framework/blazor.server.js:1:26273)
at e.processIncomingData (https://localhost:5001/_framework/blazor.server.js:1:24211)
at e.connection.onreceive (https://localhost:5001/_framework/blazor.server.js:1:17296)
at WebSocket.i.onmessage (https://localhost:5001/_framework/blazor.server.js:1:46513)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Vditor.Preview.SetPreview() in /Users/zhoudali/Downloads/vditor-blazor-master/src/Vditor/Components/Preview.razor.cs:line 76
at Vditor.Preview.OnAfterRenderAsync(Boolean firstRender) in /Users/zhoudali/Downloads/vditor-blazor-master/src/Vditor/Components/Preview.razor.cs:line 68
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

@ElderJames
Copy link
Member

Please add the vditor links in _Host.cshtml

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.css" />
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js" defer></script>
    <script src="_content/Vditor/vditor-blazor.js"></script>

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