How do I get syncfusion-blazor.min.js to load from other path?

I'm hosting a wasm project in https://localhost/VDU/
My index.html specifiesrel='nofollow' href="/VDU/">
The correct path for syncfusion-blazor.min.js is /VDU/_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js, but some code tries to fetch /_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js (thereby not respecting the base rel='nofollow' href)

I've tried including

in my index.html, but this doesn't stop the incorrect request from happening.

What do I need to do to make this request use the correct url?




4 Replies 1 reply marked as answer

MK Muthukumar Kannan Syncfusion Team November 23, 2020 10:29 AM UTC

Hi Oliver,

Thanks for contacting Syncfusion Support.

We have validated your query for 'facing a script loading issue in the hosted application'. We want to let you know that the reported issue was already resolved, and the fix included in the v18.3.0.48 package. So, we would suggest you upgrade the syncfusion blazor package to 18.3.0.48 or later versions.

If you still face the error, please share the below details.
  1. In which version syncfusion package do you face the error?
  2. is your Wasm application's target framework 3.1 or 5.0?
  3. In which browser do you face this error?
The above details will help us to provide better and quick support from our end

kindly please let us know if you have any concerns.

Regards,
Muthukumar K


QU quang December 6, 2020 11:02 AM UTC

Hello,
I also got this error. When run the exe (Kestrel) file directly
  1. In which version syncfusion package do you face the error?
  2. is your Wasm application's target framework 3.1 or 5.0?
  3. In which browser do you face this error?
1. Version: 18.3.0.52
2. I use Blazor Server, Net 5.0
3. Browser: Chromium

Sincerely,
Q, V


MK Muthukumar Kannan Syncfusion Team December 7, 2020 06:15 PM UTC

Hi Quang,

Thanks for your update.

Currently, we are validating your issue with the provided information as you mentioned. However, we will provide details and update on this within 9th December 2020.

Until then we appreciate your patience.

Please let us know if you have any concerns about this.
 
Regards,
Muthukumar K



MK Muthukumar Kannan Syncfusion Team January 11, 2021 10:01 AM UTC

Hi Quang, 

Sorry for the delayed update.

We have checked your reported problem with Kestral and we are unable to reproduce it on our end. Meanwhile, we have proceeded with this issue for finding any possibilities to replicate this from our end. Based on that, we suspect that the environment is other than “Development”. So, static web assets are not loading properly.  Also, we want to inform you that the reported issue is not with the Syncfusion library and it is the behavior of the ASP.NET Core Blazor platform itself. We can refer to the below GitHub issue for more details.  
However, we can use the below configuration in a 'startup.cs' to deploy the application on the server/local.

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsEnvironment("Local") || env.IsEnvironment("Production") || env.IsEnvironment("Staging"))
            {
// For Deploying
#if (RELEASE)
                app.UseStaticFiles(new StaticFileOptions
                {
                    FileProvider = new PhysicalFileProvider(
                      Path.Combine(env.ContentRootPath, "wwwroot/_content/Syncfusion.Blazor/scripts")),
                    RequestPath = "/_content/Syncfusion.Blazor"
                });
//For local
#else
                app.UseStaticFiles(new StaticFileOptions
                {
                    FileProvider = new PhysicalFileProvider(
                    @"C:\Users\{USER-NAME}\.nuget\packages\syncfusion.blazor\{VERSION}\staticwebassets"),
                    RequestPath = "/_content/Syncfusion.Blazor"
                });
#endif
            }
          //...other snippets...
          }

We have also created a sample for your reference that you can find from the below link.


Please let us know if we misunderstood your query and you have any concerns about this.
 
Regards,
Muthukumar K


Marked as answer
Loader.
Up arrow icon