Microsoft.JSInterop.JSException: Could not find 'Radzen.createEditor' ('Radzen' was undefined). #1366

Closed
opened 2026-01-29 17:52:40 +00:00 by claunia · 5 comments
Owner

Originally created by @vpetit-reimagine on GitHub (Aug 28, 2024).

Describe the bug
There is a consistent issue with the RadzenHtmlEditor that could be related to the fact the editor is created dynamically(?).

The script it added like the following in the App.razor before the Blazor library.

<script src="@($"_content/Radzen.Blazor/Radzen.Blazor.js?v={(typeof(Radzen.Colors).Assembly.GetName().Version)}")"></script>

If we refresh the cache of the browser, it somewhat works a bit but it is not reliable as it always break again after some point (whenever we do a change on the page that is unrelated to anything Radzen touches upon).

Even tho the exception is thrown, the editor still is created.

I don't mind the issue on a local machine during development, but it is extremely problematic when it happens on a staging or production environment.

Expected behavior
The editor is created and no exception is thrown for w/e weird reason

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows
  • Browser Firefox/Edge
  • Radzen version 5.4.1
Originally created by @vpetit-reimagine on GitHub (Aug 28, 2024). **Describe the bug** There is a *consistent* issue with the RadzenHtmlEditor that could be related to the fact the editor is created dynamically(?). The script it added like the following in the `App.razor` before the Blazor library. `<script src="@($"_content/Radzen.Blazor/Radzen.Blazor.js?v={(typeof(Radzen.Colors).Assembly.GetName().Version)}")"></script>` If we refresh the cache of the browser, it somewhat works a bit but it is not reliable as it *always* break again after some point (whenever we do a change on the page that is *unrelated* to anything Radzen touches upon). Even tho the exception is thrown, the editor still is created. I don't mind the issue on a local machine during development, but it is extremely problematic when it happens on a staging or production environment. **Expected behavior** The editor is created and no exception is thrown for w/e weird reason **Screenshots** ![image](https://github.com/user-attachments/assets/e76ebf31-c8ec-4c82-9bae-8c81a8fd429c) **Desktop (please complete the following information):** - OS: Windows - Browser Firefox/Edge - Radzen version 5.4.1
Author
Owner

@akorchev commented on GitHub (Aug 28, 2024):

We need a reproduction of this issue in order to troubleshoot. You can also try moving the Radzen.Blazor.js script before blazor.web.js to see if it makes a difference.

@akorchev commented on GitHub (Aug 28, 2024): We need a reproduction of this issue in order to troubleshoot. You can also try moving the Radzen.Blazor.js script before blazor.web.js to see if it makes a difference.
Author
Owner

@vpetit-reimagine commented on GitHub (Aug 28, 2024):

We need a reproduction of this issue in order to troubleshoot. You can also try moving the Radzen.Blazor.js script before blazor.web.js to see if it makes a difference.

It is already before blazor.web.js, as mentioned previously and as shown here:
image

It will be difficult to provide you with a reproduction of it, I will see what can be done on that

@vpetit-reimagine commented on GitHub (Aug 28, 2024): > We need a reproduction of this issue in order to troubleshoot. You can also try moving the Radzen.Blazor.js script before blazor.web.js to see if it makes a difference. It is already before blazor.web.js, as mentioned previously and as shown here: ![image](https://github.com/user-attachments/assets/ec2b942b-396f-4fd3-8466-24bff4d44aee) It will be difficult to provide you with a reproduction of it, I will see what can be done on that
Author
Owner

@akorchev commented on GitHub (Aug 28, 2024):

I am afraid that without a reproduction we can't do much. It seems that Blazor tries to initialise before the Radzen.Blazor.js file has been loaded (or it failed to load/parse it). In any case you can check your browser developer tools for any errors that may have occurred before that - for example a 404 error for Radzen.Blazor.js , a parse error etc.

@akorchev commented on GitHub (Aug 28, 2024): I am afraid that without a reproduction we can't do much. It seems that Blazor tries to initialise before the Radzen.Blazor.js file has been loaded (or it failed to load/parse it). In any case you can check your browser developer tools for any errors that may have occurred before that - for example a 404 error for Radzen.Blazor.js , a parse error etc.
Author
Owner

@vpetit-reimagine commented on GitHub (Aug 29, 2024):

I am afraid that without a reproduction we can't do much. It seems that Blazor tries to initialise before the Radzen.Blazor.js file has been loaded (or it failed to load/parse it). In any case you can check your browser developer tools for any errors that may have occurred before that - for example a 404 error for Radzen.Blazor.js , a parse error etc.

When reading your reply here, I looked at the console and saw that indeed, even if Radzen is loaded correctly, any JS error that is triggered (and not catched) breaks Radzen. I wonder if that could be something that is mentioned on the documentation in a "troubleshooting common issues". I didn't see it anywhere, which could potentially prevent most reported issues.

I am not yet 100% convinced that this solves everything, but with my limited tests, catching all possible errors as they occur does seem to solve the behavior that I experienced

@vpetit-reimagine commented on GitHub (Aug 29, 2024): > I am afraid that without a reproduction we can't do much. It seems that Blazor tries to initialise before the Radzen.Blazor.js file has been loaded (or it failed to load/parse it). In any case you can check your browser developer tools for any errors that may have occurred before that - for example a 404 error for Radzen.Blazor.js , a parse error etc. When reading your reply here, I looked at the console and saw that indeed, even if Radzen is loaded correctly, any JS error that is triggered (and not catched) breaks Radzen. I wonder if that could be something that is mentioned on the documentation in a "troubleshooting common issues". I didn't see it anywhere, which could potentially prevent most reported issues. I am not yet 100% convinced that this solves everything, but with my limited tests, catching all possible errors as they occur does seem to solve the behavior that I experienced
Author
Owner

@akorchev commented on GitHub (Aug 29, 2024):

Indeed JavaScript errors usually prevent other scripts from running correctly which isn't specific to Radzen (this is why we haven't documented it).

@akorchev commented on GitHub (Aug 29, 2024): Indeed JavaScript errors usually prevent other scripts from running correctly which isn't specific to Radzen (this is why we haven't documented it).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1366