-
Notifications
You must be signed in to change notification settings - Fork 17
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
Error when publishing to GitHub pages #13
Comments
I guessed your var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
...
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddGoogleAnalytics("UA-111742878-2");
...
await builder.Build().RunAsync(); If that is true, you must rewrite your var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
...
// 👇 Please extract the service registration code into a static method named "ConfigureServices".
// (Be careful that the static method name must be "ConfigureServices" exactly. Don't miss-spelling.)
ConfigureServices(builder.Services, builder.HostEnvironment);
...
await builder.Build().RunAsync();
static void ConfigureServices(IServiceCollection services, IWebAssemblyHostEnvironment hostEnvironment)
{
services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(hostEnvironment.BaseAddress) });
services.AddGoogleAnalytics("UA-111742878-2");
} Could you try that out? Or, if my guessing is false, please disclose your |
@nakigoe Refer Program.cs of ilovedotnet. I use use the Blazor.Analytics package in my project and it works fine. If you still face an issue please share your |
@jsakamoto 様 What I loved about Your project, is that the The NuGet is working for the basic project, but
My code for a basic template: https://github.com/nakigoe/blazorwasm The website that is generated: https://blazorwasm.nakigoe.org/ Does Your app work with Cookies, Globalization, and Localization? (the standard, a bit simplified Microsoft Globalization and Localization via the .resx files) Please cast an eye on my website: |
Now I have an error in GitHub Actions when trying to utilize Your NuGet on that larger website. It seems to be about JSinterop
|
This error will happen if you use the JavaScript interop feature of Blazor in the Please understand that the pre-rendering process runs outside the web browser, inside any PC locally, like a usual console app. Therefore, there is no JavaScript engine during the publishing process. This is the reason for the limitation that the JavaScript interop can not use in the 日本語 このエラーは、「OnInitializedAsync」ライフ サイクルで Blazor の JavaScript 相互運用機能を使用する場合に発生します。 JavaScript コードは、「OnAfterRenderAsync」が呼び出された後にのみ呼び出すことができます。 これは、 プリレンダリング プロセスは、通常のコンソール アプリと同様に、Web ブラウザーの外部、ローカルの PC 内で実行されることを理解してください。 したがって、公開プロセス中に JavaScript エンジンは存在しません。 これが、プリレンダリング時の |
No. I've not intended to tell users that the generated HTML files are hidden from users. It might be your misunderstanding due to my English is terrible. I'll appreciate it if you pointed out where a paragraph of this package's document (README) lets you feel so. 日本語 生成された HTML ファイルがユーザーに対して非表示になることをユーザーに伝えるつもりはありません。 私の英語がひどいので誤解があるかもしれません。 このパッケージのドキュメント (README) のどの段落でそう感じられるかを指摘していただければ幸いです。 |
I can't imagine that the loading time of a pre-rendered Blazor application will be significantly affected by whether it is connected to a VPN or not. Could you verify the following link, Microsoft's demo site for the QuickGrid component, is also slow or not in your VPN connection environment? This site also utilizes the https://aspnet.github.io/quickgridsamples/ 日本語 プリレンダリングされた Blazor アプリケーションの読み込み時間が、VPN に接続されているかどうかによって大きな影響を受けるとは想像できません。 次のリンク (QuickGrid コンポーネントの Microsoft のデモ サイト) も、あなたの VPN 接続環境で遅いかどうかを確認していただけますか? このサイトも、 |
If you mean the "app" is this "BlazorWasmPreRendering.Build" package, the answer might be "Yes", but it depends on what you expect. Please understand the working principle of the From that perspective, the 日本語
「アプリ」がこの「BlazorWasmPreRendering.Build」パッケージであるということであれば、答えは「はい」かもしれませんが、それはあなたが何を期待しているかによって異なります。
その観点から、 |
Your English is great、英語はも大丈夫でいらっしゃるのです。 |
Thank you for your feedback! Actually, I'm a paid user of the grammarly.com premium subscription for now, so I'll refine the README document of the "BlazorWasmPreRendering.Build" package by using those tools later. And of course, I will always welcome it if you correct the README of the "BlazorWasmPreRendering.Build" and send pull requests for me. |
You can send your files to me from the following link. |
@nakigoe That method uses the For more details about this method, please follow the article written by Niels Swimburger.NET 🍔 below. Generally, this method is more complex than adding a single NuGet package because you have to write a few script codes. However, in some cases, making the app to be server-side renderable to correspond to the "BlazorWasmPreRendering.Build" package will be more complex than using |
HTML that is generated has errors according to https://validator.w3.org/nu/
|
Your extension is working for my website https://nakigoe.org, confirmed |
Here are my messages on publish from GitHub repo:
The text was updated successfully, but these errors were encountered: