Closed I2obiN closed 3 years ago
@I2obiN Could you please provide steps so that we can systematically reproduce the problem?
Hi, I have seen this weird error come up.
Package version "@adobe/cq-spa-page-model-manager": "1.1.3",
To Reproduce First spotted issue after deploying app into testing environment. Steps to see this problem locally:
Generate sample project
mvn -B archetype:generate \
-D archetypeGroupId=com.adobe.granite.archetypes \
-D archetypeArtifactId=aem-project-archetype \
-D archetypeVersion=23 \
-D aemVersion=6.5.4 \
-D appTitle="My Site" \
-D appId="mysite" \
-D groupId="com.mysite" \
-D frontendModule=angular \
-D includeExamples=y
Go to app-routing.module.ts:
Update Routes priority { path: '', redirectTo: enviroment.APP_ROOT_PATH, pathMatch: 'full', }, { matcher: AemPageMatcher, component: PageComponent, resolve: { path: AemPageDataResolver, }
Add cq:pagemodel_route_filters to customheaders.html and index.html < meta property="cq:pagemodel_route_filters" content="index,^(.)(?:index)(.)" >
Run mvn clean install -PautoInstallPackage from root
Run npm start from ui.frontend
Go to browser and access app from http://localhost:4200/index.html
App routes to http://localhost:4200/content/mysite/us/en/home.html with error from index.model.json
400 errors from index.model.json break angular app
Errors:
Expected behavior App should automatically route from http://localhost:4200/index.html to http://localhost:4200/content/us/en/mysite.html and not show errors for index.model.json
This error did not come up with old package: "@adobe/cq-spa-page-model-manager": "1.1.3",
thank you @I2obiN and @claudiab for detailed reproduction steps, we are going to work on that now.
archetype generator <=24
will still produce a buggy project, it's because:
we suggest following manual steps to fix the problem:
com.adobe.cq.core.wcm.components.extensions.amp
(keep 2.11.1)com.adobe.cq.core.wcm.components.core
(keep 2.11.1)spa.project.core.core
(keep 1.1.2)ui.frontend/package.json
) instead of @adobe/cq-*
:
@adobe/aem-angular-editable-components
@adobe/aem-spa-component-mapping
@adobe/aem-spa-page-model-manager
environment.ts
and environment.prod.ts
, make sure that path appRoot
is absolute path (like /content/mysite/us/en/home.html
)mentioned steps won't be needed for project generated with archetype 25+
Is the expected behavior to always change the location.href to appRoot for the application to load the SPA application? Our client does not want to see that after their website domain.
Describe the bug The ModelManager initializes correct on my page with "us.model.json". For some reason the aem-spa-page-model-manager then makes a request to ".model.json" a resource that can't possibly exist and gets a 400 response breaking the react application.
Package version latest
To Reproduce I cannot reproduce this, AEM suddenly started behaving like this
Expected behavior Only validated values should be passed
Additional context Page was working then suddenly was not