I created a custom route path(localhost:3000/custom-page) in react project and refer that path in the cq:pagemodel_route_filters meta property to avoid the page model data fetching. This is working as expected when navigating from the home page (or any existing aem pages) to the custom page. If we try to hit the custom page directly(localhost:3000/custom-page), we will get an error as follows.
Expected Result:
we should able to hit the URL directly without any issues.
After debugging through the code, I think the _fetchActivePageModel method is not checking if the page path is mentioned in the page model route filters or not.
I created a custom route path(localhost:3000/custom-page) in react project and refer that path in the cq:pagemodel_route_filters meta property to avoid the page model data fetching. This is working as expected when navigating from the home page (or any existing aem pages) to the custom page. If we try to hit the custom page directly(localhost:3000/custom-page), we will get an error as follows.
Expected Result: we should able to hit the URL directly without any issues.
After debugging through the code, I think the _fetchActivePageModel method is not checking if the page path is mentioned in the page model route filters or not.
https://github.com/adobe/aem-spa-page-model-manager/blob/f8c4be56fd2b3cb4e2e2f3a251ea63c68129cf1c/src/ModelManager.ts#L333
I created a fix for this: https://github.com/adobe/aem-spa-page-model-manager/compare/master...antoantonyk:issue/fetch-active-page-model-excluded-route-path