-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Sample only runs once #16395
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
Comments
Sorry for the inconvenience. I'm afraid I can't reproduce this issue. Each time I run
What's the output in the console the second time you If it does, can you use the browser's dev tools to find out more about what happens when it makes the HTTP request? For example, are there any JS errors in the console, or does the Network tab show the server responding with an error, or does the request hang open, or something else? |
@SteveSandersonMS I have the same issue. There aren't any errors in the console or network tab, and the output of However I do notice there's a difference in the DOM when I get the blank screen. I captured screenshots of the network as well if you'd like to see those. |
Same DOM here. Tried disabling browser cache, but that makes no difference. |
This is the console output of a failing run:
|
One more observation: I've modified my Main to this:
And that does get written on the browser console: |
Also seeing this issue, using Chromium. |
I've also tested again in FF, same thing. |
What's happening here is that, on build, for some reason it's not using the newer Razor compiler and hence doesn't recognise any of your components. Instead of compiling So it won't make any difference which browser you use or whether you reload, clear cache, or whatever. It's a build-time problem, not a runtime one. The most important thing I'd like to know first is whether anyone hits this issue when working on a real Blazor app project (as opposed to when working inside the Blazor repo itself via
|
Ok. I'm on it! |
Okay. The good news is that is doesn't happen in a newly created project. |
Go ahead and release ;-) |
Thanks for that info @floreseken! Release should be soon :) |
If someone is able to post steps to reproduce this on a clean machine (e.g., from a fresh Win 10 installation without any .NET or VS installation, which exact versions of each thing you install. It needs to be from a clean machine, otherwise something else you previously installed might interfere.) we'd certainly have a look. Failing that it's probably not a good thing for us to investigate since it appears that if you do have the right dependencies installed, then this issue doesn't occur (it doesn't for anyone on the Blazor team). Since our dependencies are getting rolled into the standard .NET Core SDK and VS itself, then pretty soon it will be hard not to have the correct dependencies installed so it's very likely this will cease to apply. |
OK, I managed to reproduce this issue by accident. It happens if you try to build the So if you see something like this happen, run I know this is a bit annoying; it annoys us too! Working with prerelease versions of .NET SDK generally gets tricky like this. It's all much easier for people simply build apps using the released versions of Blazor, since that will only use released .NET SDKs. |
I guess you are right, turns out I do not have the correct SDK. |
Wait a minute.. @SteveSandersonMS The readme getting started only mentions preview1, and the global.json says preview2, shouldn't the getting started be updated then? |
btw, I'm having an extremely hard time to find a download of preview2 |
@floreseken It's best not to download it manually. If you run |
Faced the same issue.. Thanks for the solution.. |
So, I clone the repo and run the
build.cmd
script. All is fine.I enter the /samples/standaloneapp/ folder and do a:
dotnet run
Open up Chome and browse to http://localhost:5000 and blazor works, awesome.
But, now if I stop the process with CTRL-C and start
dotnet run
again, the app won't run.The browser window stays blank and there is no error or exception whatsoever. Just nothing.
When I run the
build.cmd
in the root of the solution again and thendotnet run
in the sample folder, everything works again.Is this expected behavior? What might be the problem here?
The text was updated successfully, but these errors were encountered: