Skip to content
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

React app does not load on publish instance due to HierarchyPageImpl #54

Closed
cqsapient opened this issue Jun 19, 2019 · 6 comments
Closed

Comments

@cqsapient
Copy link

cqsapient commented Jun 19, 2019

When there is no access to /conf folder ( and hence the page policy) to anonymous user on publish instance, then content attribute is empty as it gets populated via HierarchyPageImpl and code is not able to access conf folder

<meta property="cq:pagemodel_root_url"/>

so to fetch the model json it accesses the current page's model

image
 

But when anonymous user has access to 'conf' folder, then it is populated

<meta property="cq:pagemodel_root_url" content="/content/mysite/en.model.json"/>  

and now there are two calls to for model.json

image

because of these two calls nothing gets loaded in the app. I know the call is originated by page model manager, but the app should load in case of two calls as well, or the page specific call should not be initiated when rootmodel url is populated.

For now I removed the content attribute in rootmodel meta tag altogether, please let me know the better and appropriate solution.

@cqsapient
Copy link
Author

The two calls originate only on dispatcher - on publish, when cq:pagemodel_root_url is populated, only once call(rightly so) on the root page is sent to fetch the model, but in dispatcher with the shortened url and without .html , two calls originate. Please let me know if a cleaner solution is available.

@samuelmeuli
Copy link
Contributor

The AEM Project Archetype can now be used to generate SPA projects and includes a fix for this issue. Please use that project as a reference.

@epsilon-svenkatesh
Copy link

What was the exact fix for this issue in the new archetype. We are seeing a similar issue in our older project. It would be of great help if you can share the details of exact fix for the issue.

@pfauchere
Copy link
Contributor

@samuelmeuli do you recall what was the actual fix?

@samuelmeuli
Copy link
Contributor

It was fixed in this PR: adobe/aem-spa-project-archetype#131

@rohanraj14
Copy link

@samuelmeuli We are facing similar issue for our SPA page in dispatcher, although we allowed everyone access to /conf, still the content in meta for cq:pagemodel_root_url
<meta property="cq:pagemodel_root_url" content="/content/en-us/categories.model.json"/>

If from cache I remove this content value manually it fixes and loads the SPA.
Any idea how to look/debug further. Appreciate your help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants