Comments (12)
For anyone else with this issue, calling
dotnet run
will not set theASPNETCORE_ENVIRONMENT
variable. If it isn't set, it defaults to Production. Static web assets are enabled by default in the Development environment, so runningdotnet 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();
}
from typeahead.
Have you tired doing a full clean and rebuild? Do you have the .NET Core 3 SDK installed? I use this project most days at the moment for testing new features so it definitely works.
from typeahead.
Clean and rebuild without success, though if I start debugging inside VSCode then everything seems to work. If I call dotnet run
from the command line then blazored-typeahead.css
and blazored-typeahead.js
are not found resulting in the error.
dotnet --list-sdks
3.0.100 [/usr/local/share/dotnet/sdk]
from typeahead.
I'm not sure what to suggest. I've tried the sample on my personal laptop, my work laptop and my wife's MacBook and it runs fine on all of them. I think this may be a local issue on your machine I'm afraid.
Just to be sure we're doing the same thing. I got the latest from master moved into the samples\BlazorServerSide\
directory and ran dotnet run
. I then opened the app in a browser - everything runs fine.
from typeahead.
Odd, shall close this then. Thanks for looking into the issue anyway! :)
from typeahead.
I'm really sorry I couldn't help with this one. It's very strange.
The only other thing I can think of is deleting and recloning the repo. Also have you tried doing a clean and rebuild and then opening the site in a incognito window? Sounds odd but might show if there is any weird cacheing issue.
from typeahead.
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.
from typeahead.
Hi, I'm also getting Error: Microsoft.JSInterop.JSException: Could not find 'blazoredTypeahead' in 'window'. when using Blazor Server Side in IE11 with blazor.polyfill.min.js. Your example code does not show that you are using IE11 polyfills. Can you please test with polyfills and show your configuration if successful. Or let me know if it's broken so I can move on. Great code you've got in every other browser!
from typeahead.
@SteveHindmarsh IE11 isn't a supported browser I'm afraid, but the typeahead does only use very simple JS functions so things should work.
The error you're seeing is because the JS file isn't being included or run. Does the app work ok in a modern browser?
from typeahead.
Yes it works ok in modern supported browsers. However IE11 is unofficially supported for Blazor Server Side via the use of polyfills and many people like myself, in a corporate environment where IE is essential until we kill all the websites that require it, are making use of these polyfills so we can keep our skills modern whilst dealing with these behemoths. The choice is yours to support us. This seems to be the defacto standard for the polyfill at the moment https://github.com/Daddoon/Blazor.Polyfill/releases
Please let me know if this issue is to remain closed then I can decide to move on with another typeahead component or failing that endeavour to fix yours (this will be a mountain for me at this point)? Thanks
from typeahead.
Thanks for checking that out Steve. I'm more than happy to take a PR for IE11 support, but it's not something I have time to add support for. As you can appreciate, I do this in my spare time alongside a full-time job.
from typeahead.
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'.
from typeahead.
Related Issues (20)
- [Question] Is there a way to programmatically select multiple items? HOT 1
- [Bug] When used in a child component in multiselect mode items not added when selected HOT 1
- Have a OnClose Option for the Dropdown list
- [Question] Are you able to just use strings for Value and date related bindings on the control?
- Two way binding
- Typeahead search text dissapearing from search box after displaying results in v 4.7.0 HOT 14
- [Feature Request] Option to disable deleting items with "Backspace" when using MultiSelect
- Method to Force results dropdown to close?
- how to Enable mutli line
- Laptop touchpad not selecting item in results
- Error in "Using complex types but only binding to a single property" HOT 1
- [Bug] - blazored-typeahead results hides behind the modal-footer
- [Bug] Typeahead inside Blazored.Modal search text erase with .NET 7.0 HOT 3
- [Question] How to Justify Dropdown Content
- [Bug] ArgumentNullException after pressing 'backspace' key
- Clicking typeahead inside MudTable in <MudTd> by MudBlazor not set to Focus
- [Bug] Multiple Pasting of text into the control causes app pool to crash
- WORK PAUSED - PLEASE READ BEFORE POSTING AN ISSUE HOT 1
- how to set category id for Searchmethod HOT 1
- Scroll in dropdown menu
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typeahead.