ButterCMS / dotnet-starter-buttercms

Drop-in proof-of-concept .NET app, fully integrated with your ButterCMS account
https://dotnet-starter-buttercms.herokuapp.com/
0 stars 2 forks source link

fix: show not found page in case landing page is not found #33

Closed vlnevyhosteny closed 2 years ago

ViolanteCodes commented 2 years ago

@vlnevyhosteny I'm still seeing an exception when I try to navigate to 'landing-page/alternate-landing-page'. This page exists, so I don't know why we would want a Page Not Found error here? (Here is the page in Butter, can log in with dev credentials to see it: https://buttercms.com/pages/page/319981/)


An unhandled exception occurred while processing the request. NullReferenceException: Object reference not set to an instance of an object. AspNetCore.Views_Shared__HeroSection.ExecuteAsync() in _HeroSection.cshtml, line 3

Stack Query Cookies Headers Routing NullReferenceException: Object reference not set to an instance of an object. AspNetCore.Views_Shared__HeroSection.ExecuteAsync() in _HeroSection.cshtml +

Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.RenderPartialCoreAsync(string partialViewName, object model, ViewDataDictionary viewData, TextWriter writer) Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.PartialAsync(string partialViewName, object model, ViewDataDictionary viewData) AspNetCore.Views_Home_Index.ExecuteAsync() in Index.cshtml + @await Html.PartialAsync("_HeroSection", Model.HeroSection) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable statusCode) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable statusCode) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, string contentType, Nullable statusCode) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result) Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|29_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context) Show raw exception details System.NullReferenceException: Object reference not set to an instance of an object. at AspNetCore.Views_Shared__HeroSection.ExecuteAsync() in C:\Users\Maria\Desktop\dotnet-starter-buttercms\ButterCMS.Starter\Views\Shared\_HeroSection.cshtml:line 3 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.RenderPartialCoreAsync(String partialViewName, Object model, ViewDataDictionary viewData, TextWriter writer) at Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.PartialAsync(String partialViewName, Object model, ViewDataDictionary viewData) at AspNetCore.Views_Home_Index.ExecuteAsync() in C:\Users\Maria\Desktop\dotnet-starter-buttercms\ButterCMS.Starter\Views\Home\Index.cshtml:line 13 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result) at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
vlnevyhosteny commented 2 years ago

@ViolanteCodes Are you trying that agains Heroku instance? Locally is just fine for me.

Regarding to landing-page/alternate-landing-page It's not found for React (https://react-starter-buttercms-demo.vercel.app/landing-page/alternate-landing-page) nor Django (https://django-starter-buttercms-demo.herokuapp.com/landing-page/alternate-landing-page).

ViolanteCodes commented 2 years ago

@vlnevyhosteny it doesn't work either locally or on a freshly deployed heroku instance for me: video

Yes, we have tickets in to fix both the django landing page and react landing page issues on our end. If this seems like its not going to be easily fixable, let me know, and I can let the team know where we're at with this feature and if we want to pursue it further as it's not as crucial as the other elements.

vlnevyhosteny commented 2 years ago

@ViolanteCodes

it doesn't work either locally or on a freshly deployed heroku instance for me: video

I can see that you are on feat/update-readme branch which does not contain the fix. Pls switch to fix/not-found-landing-page.

Problem with landing-page/alternate-landing-page fixed in 97c2f99. It was not expecting missing sections.

ViolanteCodes commented 2 years ago

@ViolanteCodes

it doesn't work either locally or on a freshly deployed heroku instance for me: video

I can see that you are on feat/update-readme branch which does not contain the fix. Pls switch to fix/not-found-landing-page.

Problem with landing-page/alternate-landing-page fixed in 97c2f99. It was not expecting missing sections.

@vlnevyhosteny 🤦 Yep, would help to be on right branch.

However, I just checked this out to what I believe is the correct branch/PR, and now the components are all missing completely?

video

vlnevyhosteny commented 2 years ago

@ViolanteCodes

Fixed in https://github.com/ButterCMS/dotnet-starter-buttercms/pull/33/commits/f9690c25d5a564100fcba975b9e5aea3a4ada498