adobe / aem-cif-guides-venia Goto Github PK
View Code? Open in Web Editor NEWAEM CIF Venia Project
License: Apache License 2.0
AEM CIF Venia Project
License: Apache License 2.0
No javascript errors thrown
The following error occurs when opening the venia site on publish instance through a dispatcher that is configured to go to a magento cloud instance
Could not fetch storefront instance context Error: Cannot query field "dataServicesStorefrontInstanceContext" on type "Query".
at new t (clientlib-site.js:705)
at clientlib-site.js:705
at r (clientlib-site.js:705)
at clientlib-site.js:705
at new Promise (<anonymous>)
at Object.then (clientlib-site.js:705)
at Object.next (clientlib-site.js:705)
at O (clientlib-site.js:705)
at E (clientlib-site.js:705)
at e.t.next (clientlib-site.js:705)
AEM 6.5.9 (on-premise in Azure)
Docker Dispatcher: https://github.com/adobe/aem-core-cif-components/tree/master/dispatcher
Adobe Commerce AddOn 2021 10 05
aem-cif-guides-venia main branch
As a developer, I want an npm watch command so that frontend changes can be synced to AEM automatically
To speed up development
Code changes to webpack config
When cif:addToCart or cif:addToWishList events are triggered in the data layer, they should produce event.message.eventInfo
:
{
"@id": "product-363db96fd9",
"xdm:SKU": "VP09-KH-M",
"xdm:quantity": "1"
}
The @id can then be used to find the product component in the window.adobeDataLayer.getState("component."+event.message.eventInfo["@id"])
which should produce:
{
"xdm:currencyCode": "USD",
"xdm:categories": ["categories array here"],
"xdm:assets": ["asset array here"],
"xdm:SKU": "VP09",
"xdm:listPrice": 78,
"dc:description": "<p>The Lenora Crochet Shorts are perfect for those days when the weather dictates your wardrobe options. The good news is you can keep cool and still look good. These cotton shorts have got you covered. </p><p>Features:</p><ul><li>Elastic waist </li><li>Drawstring waist</li><li>Sit just below the waist</li><li>4" inseam</li><li>Hand wash, line dry</li></ul>",
"dc:title": "Lenora Crochet Shorts",
"@type": "venia/components/commerce/product",
"parentId": "page-f9dfabef95"
}
The @id produced by event.message.eventInfo
is not the same id that's in the fullstate, which makes it very difficult to get product information of the triggered event. Example:
Here's a full cif:addToWishList
event:
{
"message": {
"event": "cif:addToWishList",
"eventInfo": {
"@id": "product-363db96fd9",
"xdm:SKU": "VP09-KH-M",
"xdm:quantity": "1"
}
},
"beforeState": {},
"afterState": {},
"fullState": {
"page": {
"page-f9dfabef95": {
"@type": "core/wcm/components/page/v2/page",
"repo:modifyDate": "2022-02-23T19:04:48Z",
"dc:title": "Venia Demo Store - Product page",
"xdm:template": "/conf/venia/settings/wcm/templates/product-page",
"xdm:language": "en",
"xdm:tags": [],
"repo:path": "/content/venia/us/en/products/product-page.html"
}
},
"component": {
"navigation-29eb2932ca": {
"@type": "core/wcm/components/navigation/v1/navigation",
"parentId": "page-f9dfabef95"
},
"searchbar-220bd1c383": {
"@type": "venia/components/commerce/searchbar",
"parentId": "page-f9dfabef95"
},
"breadcrumb-9a2f8da940": {
"repo:modifyDate": "2020-08-17T14:22:56Z",
"@type": "venia/components/commerce/breadcrumb",
"parentId": "page-f9dfabef95"
},
"breadcrumb-9a2f8da940-item-88fb9dce60": {
"@type": "venia/components/commerce/breadcrumb/item",
"repo:modifyDate": "2022-02-23T19:04:48Z",
"dc:title": "Home",
"xdm:linkURL": "/content/venia/us/en.html",
"parentId": "breadcrumb-9a2f8da940"
},
"breadcrumb-9a2f8da940-item-bc0e6fdec7": {
"dc:title": "Bottoms",
"xdm:linkURL": "/content/venia/us/en/products/category-page.html/venia-bottoms.html",
"repo:modifyDate": "2022-02-23T19:04:48Z",
"@type": "venia/components/page",
"parentId": "breadcrumb-9a2f8da940"
},
"breadcrumb-9a2f8da940-item-ba2b346a0c": {
"dc:title": "Pants & Shorts",
"xdm:linkURL": "/content/venia/us/en/products/category-page.html/venia-bottoms/venia-pants.html",
"repo:modifyDate": "2022-02-23T19:04:48Z",
"@type": "venia/components/page",
"parentId": "breadcrumb-9a2f8da940"
},
"breadcrumb-9a2f8da940-item-11baf3bf2a": {
"dc:title": "Lenora Crochet Shorts",
"xdm:linkURL": "/content/venia/us/en/products/product-page.html/venia-bottoms/venia-pants/lenora-crochet-shorts.html",
"repo:modifyDate": "2022-02-23T19:04:48Z",
"@type": "venia/components/page",
"parentId": "breadcrumb-9a2f8da940"
},
"product-4e2b208d40": {
"xdm:currencyCode": "USD",
"xdm:categories": [
{
"repo:id": "category-cf9d757f29",
"xdm:name": "Bottoms",
"xdm:asset": {
"@type": "image",
"repo:path": "https://jnz3dtiuj77ca.dummycachetest.com/media/catalog/category/minimalist.jpg",
"repo:id": "image-dad411636d"
}
},
{
"repo:id": "category-6e60cf4797",
"xdm:name": "Pants & Shorts"
}
],
"xdm:assets": [
{
"@type": "image",
"repo:path": "https://jnz3dtiuj77ca.dummycachetest.com/media/catalog/product/cache/049921ef33cf983997e4a4ee02ef4cc5/v/p/vp09-pe_main_2.jpg",
"repo:id": "image-36fd81b46c"
},
{
"@type": "image",
"repo:path": "https://jnz3dtiuj77ca.dummycachetest.com/media/catalog/product/cache/049921ef33cf983997e4a4ee02ef4cc5/v/p/vp09-pe_alt_1.jpg",
"repo:id": "image-d3fc1369c0"
},
{
"@type": "image",
"repo:path": "https://jnz3dtiuj77ca.dummycachetest.com/media/catalog/product/cache/049921ef33cf983997e4a4ee02ef4cc5/v/p/vp09-pe_back_1.jpg",
"repo:id": "image-ed01dcdf01"
}
],
"xdm:SKU": "VP09",
"xdm:listPrice": 78,
"dc:description": "<p>The Lenora Crochet Shorts are perfect for those days when the weather dictates your wardrobe options. The good news is you can keep cool and still look good. These cotton shorts have got you covered. </p><p>Features:</p><ul><li>Elastic waist </li><li>Drawstring waist</li><li>Sit just below the waist</li><li>4" inseam</li><li>Hand wash, line dry</li></ul>",
"dc:title": "Lenora Crochet Shorts",
"@type": "venia/components/commerce/product",
"parentId": "page-f9dfabef95"
},
"text-7fcb8179bf": {
"@type": "venia/components/text",
"xdm:text": "<p> </p>\r\n<p><b>Account</b></p>\r\n<p> </p>\r\n<p>Sign In</p>\r\n<p> </p>\r\n<p>Register</p>\r\n<p> </p>\r\n<p>Order Status</p>\r\n<p> </p>\r\n<p>Returns</p>\r\n<p> </p>\r\n<p> </p>\r\n",
"parentId": "page-f9dfabef95"
},
"text-7a5cd87f09": {
"@type": "venia/components/text",
"repo:modifyDate": "2021-02-24T13:59:33Z",
"xdm:text": "<p> </p>\r\n<p><b>About Us</b></p>\r\n<p> </p>\r\n<p>Our Story</p>\r\n<p> </p>\r\n<p>Email Signup</p>\r\n<p> </p>\r\n<p>Give Back</p>\r\n<p> </p>\r\n<p> </p>\r\n",
"parentId": "page-f9dfabef95"
},
"text-f31246b3d7": {
"@type": "venia/components/text",
"xdm:text": "<p> </p>\r\n<p><b>Help</b></p>\r\n<p> </p>\r\n<p>Live Chat</p>\r\n<p> </p>\r\n<p>Contact Us</p>\r\n<p> </p>\r\n<p>Order Status</p>\r\n<p> </p>\r\n<p>Returns</p>\r\n<p> </p>\r\n<p> </p>\r\n",
"parentId": "page-f9dfabef95"
},
"text-3141486461": {
"@type": "venia/components/text",
"xdm:text": "<p> </p>\r\n<p><b>Follow Us!</b></p>\r\n<p> </p>\r\n<p>Lorem ipsum dolor sit amet, consectetur adipsicing elit, sed do eiusmod tempor incididunt ut labore et dolore.</p>\r\n<p> </p>\r\n",
"parentId": "page-f9dfabef95"
},
"footerCopyright": {
"@type": "venia/components/text",
"xdm:text": "<p>Copyright 2020, Venia. All rights reserved.</p>\r\n<p>345 Park Avenue, San Jose, CA 95110-2704, USA</p>\r\n",
"parentId": "page-f9dfabef95"
}
},
"productContext": {
"sku": "VP09",
"name": "Lenora Crochet Shorts",
"productId": 0
},
"shopperContext": {
"shopperId": "guest"
},
"customUrlContext": {
"customUrl": "https://publish-p56998-e443732.adobeaemcloud.com/content/venia/us/en/products/product-page.html/venia-bottoms/venia-pants/lenora-crochet-shorts.html"
},
"referrerUrlContext": {
"referrerUrl": "https://publish-p56998-e443732.adobeaemcloud.com/content/venia/us/en/products/category-page.html/venia-bottoms/venia-pants.html"
}
},
"$type": "gcoe-adobe-client-data-layer.datalayer-push",
"$rule": {
"id": "RLa43254d3d672424b8af9dccc159fc394",
"name": "Track Data on push event"
}
}
adobeDataLayer
AEM Cloud Service
Magento headless: https://venia.magento.com/graphql
The code build should be SUCCESS
Venia - UI Frontend module is failing with errors
1. Clone the Venia Project Codebase
2. Run the command **mvn clean install** on the project root directory.
3. UI Frontend module gets failed with the following error:
4. The error that caused to fail the frontend module is **[ERROR] 'rm' is not recognized as an internal or external
command**
5. The command that fails is the **i18n:extract-compile** build script from package.json
"i18n:extract-compile": "formatjs extract --out-file i18n/__temp.json 'src/**/*.js' && formatjs compile --ast --out-file
i18n/en.json i18n/__temp.json && **rm i18n/__temp.json**"
6. When debugged the 'rm' command error, a few articles mention about using either 'del' or 'rd' command in place of rm.
Reference1 -
Reference2 -
https://reactgo.com/rm-command-not-recognized/
7. If we update the command with 'del' or 'rd' we get the below error:
Hi @mhaack,
Kindly help to resolve this issue.
Best Regards,
Arpitha
As a developer I'd like to deploy changes made to the core
OSGi bundle directly to an AEM environment using the profile autoInstallBundle
but not build the entire project.
It is time consuming to build the entire project (including the ui.frontend
module) every time, especially if changes are only in the bundle.
If I run the command mvn clean install -PautoInstallBundle,cloud
from within the core
folder:
I get the following message:
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ venia.core ---
[INFO] No primary artifact to install, installing attached artifacts instead.
[INFO] Installing /Users/Documents/code/aem-cif-guides-venia/core/pom.xml to /Users/.m2/repository/com/venia/venia.core/2020.8.15-SNAPSHOT/venia.core-2020.8.15-SNAPSHOT.pom
[INFO] Installing /Users/Documents/code/aem-cif-guides-venia/core/target/venia.core-2020.8.15-SNAPSHOT-cloud.jar to /Users/.m2/repository/com/venia/venia.core/2020.8.15-SNAPSHOT/venia.core-2020.8.15-SNAPSHOT-cloud.jar
[INFO]
[INFO] --- sling-maven-plugin:2.4.0:install (install-bundle) @ venia.core ---
[INFO] /Users/Documents/code/aem-cif-guides-venia/core/target/venia.core-2020.8.15-SNAPSHOT.jar does not exist, no uploading
I can run the same command from the root of the project and it works, but then the entire project gets built anyway.
Provide instructions and/or build parameters to build and deploy just the core bundle without the rest of the project.
aem-cif-guides-venia/core
mvn clean install -PautoInstallBundle,cloud
I can build the Venia reference site from the main branch, and deploy it into a local AEM instance
Maven build fails for the "Venia - UI apps" module:
Failed to execute goal org.apache.jackrabbit:filevault-package-maven-plugin:1.1.4:package (create-package) on project venia.ui.apps: java.lang.IllegalStateException: basedir C:\Develop\github\aem-cif-guides-venia\ui.apps\target\vault-work does not exist
$ git clone https://github.com/adobe/aem-cif-guides-venia
$ cd aem-cif-guides-venia/
$ mvn clean install -PautoInstallPackage,classic
Windows 10, running mvn from git bash
$ mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: C:\Java\apache-maven-3.6.0
Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: C:\Java\jdk1.8.0_201\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
[INFO] --- filevault-package-maven-plugin:1.1.4:package (create-package) @ venia.ui.apps ---
[INFO] Using META-INF/vault from C:\Develop\github\aem-cif-guides-venia\ui.apps\src\main\content\META-INF\vault
[INFO] Packaging content from C:\Develop\github\aem-cif-guides-venia\ui.apps\src\main\content\jcr_root
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for venia 1.0.0-SNAPSHOT:
[INFO]
[INFO] venia .............................................. SUCCESS [ 0.651 s]
[INFO] Venia - Core ....................................... SUCCESS [ 16.979 s]
[INFO] venia.ui.frontend - UI Frontend .................... SUCCESS [01:26 min]
[INFO] Venia - Repository Structure Package ............... SUCCESS [ 1.679 s]
[INFO] Venia - UI apps .................................... FAILURE [ 10.156 s]
[INFO] Venia - UI content ................................. SKIPPED
[INFO] Venia - All ........................................ SKIPPED
[INFO] Venia - Integration Tests .......................... SKIPPED
[INFO] Venia - Dispatcher AMS ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:58 min
[INFO] Finished at: 2020-08-13T13:52:39+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.jackrabbit:filevault-package-maven-plugin:1.1.4:package (create-package) on project venia.ui.apps: java.lang.IllegalStateException: basedir C:\Develop\github\aem-cif-guides-venia\ui.apps\target\vault-work does not exist -> [Help 1]
[ERROR]
The "ui.apps/target/vault-work" directory indeed does not exist (but a "vault-work-classic" directory is present):
$ ls -als ui.apps/target/
total 1649
4 drwxr-xr-x 1 ssauder 1049089 0 Aug 13 13:52 ./
0 drwxr-xr-x 1 ssauder 1049089 0 Aug 13 13:52 ../
0 drwxr-xr-x 1 ssauder 1049089 0 Aug 13 13:52 classes/
0 drwxr-xr-x 1 ssauder 1049089 0 Aug 13 13:52 generated-sources/
0 drwxr-xr-x 1 ssauder 1049089 0 Aug 13 13:52 maven-archiver/
0 drwxr-xr-x 1 ssauder 1049089 0 Aug 13 13:52 maven-status/
1 -rw-r--r-- 1 ssauder 1049089 248 Aug 13 13:52 vault-generated-import.txt
0 drwxr-xr-x 1 ssauder 1049089 0 Aug 13 13:52 vault-work-classic/
1644 -rw-r--r-- 1 ssauder 1049089 1679863 Aug 13 13:52 venia.ui.apps-1.0.0-SNAPSHOT-classic.zip
CartPage is working correctly
javascript stops on CartPage
venia-2021.11.01
We implemented a CartPage based on this component/structure:
https://github.com/adobe/aem-cif-guides-venia/tree/venia-2021.11.01/ui.frontend/src/main/components/CartPage
We have the issue that by using the Quantity component from @magento/venia-ui
(as you also do in your aem-cif-guides-venia project, at this line: https://github.com/adobe/aem-cif-guides-venia/blob/venia-2021.11.01/ui.frontend/src/main/components/CartPage/ProductListing/product.js#L120) we get the following error thrown out of the following component: https://github.com/magento/pwa-studio/blob/v8.0.0/packages/venia-ui/lib/components/CartPage/ProductListing/quantity.js#L12
Uncaught TypeError: formApi.getValue is not a function
For us it looks like the React context from the used informed
library is not available.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.