I installed pwa my local directory. but I want to override js my component in the src directory. so please anyone help me?
How to Override .js File in Magento PWA Studio
pwapwa-studio
Related Solutions
I also faced same issue. After so much trouble and research I found that while we run bash deployVeniaSampleData.sh
command, Magento tries to find authentication from github.
Please follow below steps to resolve your issue:
1) Copy auth.json.sample file placed on Magento root directory and paste it on same place.
2) Rename auth.json(copy).sample file to auth.json and open it in your editor.
3) Login to Magento Marketplace. If you don’t have an account, click Register.
3.1) Click your account name in the top-right of the page and select My Profile.
3.2) Click Access Keys in the Marketplace tab.
3.3) Click Create a New Access Key. Enter a specific name for the keys (e.g., the name of the developer receiving the keys) and click OK.
3.4) New public and private keys are now associated with your account that you can click to copy. Save this information or keep the page open when working with your Magento project. Use the Public key as your username and the Private key as your password.
4) Login to GitHub account.
4.1) Click your account name in the top-right of the page and select Settings.
4.2) Click on Developer Settings tab at the last in left sidebar.
4.3) Click on Personal access token tab and create your access token. You will get access token which you have to put as value of github.com in auth.json.
5) Run php bin/magento cache:flush command
6) Run bash deployVeniaSampleData.sh command
I hope this may helpful to everyone!!
The error indicated that the source code of your Storefront was not compatible with your M2 backend. You need to check the configuration file of the 'venia-concept' (at .../packages/venia-concept/.env) to see if your M2 backend was the one that Magento provided https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud or another one specified in your local instance.
If you're using a local M2 backend, make sure it works fine with https.
Meanwhile, we wonder if you have tried using the command @magento/create-pwa (first introduced in PWA Studio 5.0.0)? It's way easier to create a custom PWA project on top of Magento PWA Studio this way.
PS. We have put together a simple guide to set up a magento PWA Studio project using the above-mentioned command here (We did test with both PWA Studio 5.0.0 and 5.0.1)
Hope it helps.
Regards, Ubertheme team
Best Answer
I understand your issue with the PWA override js file into your component for that you have to add "moduleOverrideWebpackPlugin.js" this file into your root directory src/
And add below code into the file
Use the code in this file as per your requirements.
Now add code into the "local-intercept.js" file located into the src/targets/ and add below code into this file
Now if you want to override the footer component then create a footer directory in the component directory and add footer.js and index.js files to this component
After copying the file @magento/venia-ui/lib/components/Footer/footer.js to /src/lib/components/Footer/footer.js, edit the footer.js file and replace the import paths with the relevant package, so it points to the correct import path of the core component. For example,
Create a src/components/Footer/index.js file with the following content to set the default component export for the Footer directory.
For more information you can refer the magento official document guide https://developer.adobe.com/commerce/pwa-studio/tutorials/basic-modifications/modify-footer/