Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!
SOLVED

404 Error handling in AEM SPA

Avatar

Level 7

When a abc page is not found, then apache internally makes the request to 404-error-page.html(based on error directive), and I see a request for abc.model.json and en.model.json in the network tab, but I don’t see the request for 404-error-page.model.json (because html redirect is made internally by Apache). Due to which page is showing blank. 

 

Apache Error directive configuration

ErrorDocument 404 /content/en/us/error/404-error-page.html

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@iamnjain  It appears, @Leela-Pavan-Kumar is also referring the same documentation and noticing an issue Re: AEM SPA Error Page Handler - Adobe Experience League Community - 444452

 

May be you both can help each other. Please do share with us your final approach. Would be good to know. Thanks !


Aanchal Sikka

View solution in original post

10 Replies

Avatar

Employee Advisor

Hi,

Since the request for 404-error-page.model.json is not being made, it could be possible that the model for the 404 error page is not being initialized properly.

One possible solution is to explicitly initialize the model for the 404 error page in the 404-error-page.html file. You can do this by including a script tag in the HTML file that initializes the model for the page.

Avatar

Level 7

Hi @ManviSharma 

 

Can you please share one sample script. It would help a lot.

Avatar

Community Advisor

@ManviSharma 

The same issue we are facing.

Can you please explain with an example sample code snippet?

That will help.

 

Any help here @aanchal-sikka @Tanika02 @arunpatidar

@kautuk_sahniAny help here, please.

Avatar

Community Advisor

Hello @iamnjain 

 

requesting you to please refer to: AEM Spa editor - Error Page handling (aemfrontend.blogspot.com)


Aanchal Sikka

Avatar

Community Advisor

@aanchal-sikka 

Is this method recommended in AEMaaCS?

ACS AEM Commons error handle method I mean.

Avatar

Community Advisor

@iamnjain 

 

It seems to be supported on AEMaaCS 

 

Saying based on this comment on https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/2869

aanchalsikka_0-1698849168890.png

 


Aanchal Sikka

Avatar

Correct answer by
Community Advisor

@iamnjain  It appears, @Leela-Pavan-Kumar is also referring the same documentation and noticing an issue Re: AEM SPA Error Page Handler - Adobe Experience League Community - 444452

 

May be you both can help each other. Please do share with us your final approach. Would be good to know. Thanks !


Aanchal Sikka

Avatar

Community Advisor

Sure, thanks @aanchal-sikka 

Avatar

Community Advisor

Is there any other way to do error page handling in AEM SPA project?

 

 

@EstebanBustamante 

Avatar

Community Advisor

@Ronnie09  were you able to resolve this issue?