question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server side sample blazoredTypeahead could not be found

See original GitHub issue

I get the following exception when running the server side example project:

Microsoft.JSInterop.JSException: Could not find 'blazoredTypeahead' in 'window'.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
sven-ncommented, Feb 22, 2020

For anyone else with this issue, calling dotnet run will not set the ASPNETCORE_ENVIRONMENT variable. If it isn’t set, it defaults to Production. Static web assets are enabled by default in the Development environment, so running dotnet run --environment "Development" fixed the issue.

To make it work for all environments, call UseStaticWebAssets() on the IWebHostBuilder when you set up your IHost, e.g. in your Program.cs.

Example:

        public static void Main(string[] args)
        {
            var host = Host.CreateDefaultBuilder(args)
                .ConfigureServices(serviceCollection =>
                {
                    // ...
                })
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                    webBuilder.UseStaticWebAssets(); // <---
                })
                .Build();
            host.Run();
        }
0reactions
Mansha786commented, Oct 26, 2020

I get the following exception when running the server side example project: [2020-10-26T08:35:17.128Z] Error: Microsoft.JSInterop.JSException: Could not find ‘BlazoredModal’ in ‘window’. Error: Could not find ‘BlazoredModal’ in ‘window’.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started With Blazored Typeahead
In this post, I'm talking about the latest component in the Blazored collection, Blazored.Typeahead. I'm covering how to get it, ...
Read more >
Blazor Server - static files don't link in non-DEV environments
You just have to include the static content via <link href="..." /> as you did. However, when running the app from the build...
Read more >
Blazored.Typeahead 2.0.1
There is currently an issue with Server-side Blazor apps (not Client-side Blazor). They are unable to import static assets from component ...
Read more >
My experience about Blazor
I've been doing web development using Blazor for more than 1 year. I used to also worked on some angular and react.
Read more >
Blazor code behind not working. Two things that may help ...
I found a method for storing user data in a server-side session. ... If your using Blazor Server (not WebAssembly) you can only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found