Comments (8)
process.env file at Root
LEGACY_BACKEND_DOMAIN=https://zzkc-001.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.store/Sites-RefArch-Site/
LEGACY_BACKEND_HOST_HEADER=https://zzkc-001.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.store/Sites-RefArch-Site/
CLIENT_ID=477c9069-ff51-4ead-961c-f58ef1adaa04
ORGANIZATION_ID=f_ecom_ZZKC_001
SHORT_CODE=kv7kzm78
SITE_ID=RefArch
from react-storefront.
I am not able to reproduce this error.
What version of node, react-storefront, xdn, and next are you using?
And how did you initialize the project?
from react-storefront.
Node v12.18.3
react-storefront : 8.11.0
next : 9.3.6
I am trying it on my local machine.
I created a new react storefront, then installed react-storefront-salesforce-commerce-cloud-connector.
After that, I have put a process.env file at Root which looks like this
LEGACY_BACKEND_DOMAIN=https://zzkc-001.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.store/Sites-RefArch-Site/
LEGACY_BACKEND_HOST_HEADER=https://zzkc-001.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.store/Sites-RefArch-Site/
CLIENT_ID=477c9069-ff51-4ead-961c-f58ef1adaa04
ORGANIZATION_ID=f_ecom_ZZKC_001
SHORT_CODE=kv7kzm78
SITE_ID=RefArch
I have made changes in next.config.js to change the connector name as mentioned in github steps.
after all these steps when I try to start it by "npm start" I am getting the above error.
from react-storefront.
Very odd... I just used a Windows machine to test this as well and I am still not getting this error.
What version of Windows are you running?
And it seems like your SFCC permissions are not quite correct for the API. I am not able to create a token.
from react-storefront.
change ORGANIZATION_ID to f_ecom_zzkc_001 and you will get the token.
I am using windows 10.
I have found that the reason behind this error might be the node version doesnโt support ES6 export syntax.
Can you plz mention what version of node, npm and next are required for this connector??
from react-storefront.
@asadkhawaja1 I installed the exact version of node you were using. I used nvm-windows to install it.
from react-storefront.
@dijs I am now able to start the APP but when I hit http://127.0.0.1:3000/ I get below error in terminal
Fetching https://kv7kzm78.api.commercecloud.salesforce.com/product/shopper-products/v1/organizations/f_ecom_zzkc_001/categories/root?siteId=RefArch&levels=2
Fetching https://kv7kzm78.api.commercecloud.salesforce.com/product/shopper-products/v1/organizations/f_ecom_zzkc_001/categories/root?siteId=RefArch&levels=2
client status Forbidden
Error: {"type":"https://api.commercecloud.salesforce.com/documentation/error/v1/errors/forbidden","title":"Forbidden","detail":"Your shopper JWT is valid, but you have no permissions to access the resource."}
at fetchWithToken (D:\Work\Salesforce\Sample Apps\sfcc-connector.next\server\pages\api.js:918:15)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async createAppData (D:\Work\Salesforce\Sample Apps\sfcc-connector.next\server\pages\api.js:1141:7)
at async Promise.all (index 1)
Could not connect to backend https://zzkc-001.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.store/Sites-RefArch-Site: getaddrinfo ENOTFOUND
Can you plz have a look and tell what am I doing wrong?
Even in postman when I hit for
https://{{shortCode}}.api.commercecloud.salesforce.com/product/shopper-products/v1/organizations/{{organizationId}}/categories/root?siteId=RefArch&levels=2
I get
{"type":"https://api.commercecloud.salesforce.com/documentation/error/v1/errors/forbidden","title":"Forbidden","detail":"Your shopper JWT is valid, but you have no permissions to access the resource."}
from react-storefront.
It looks like the page cannot be rendered because the API could not fetch the required data. Most likely the list of categories. Seems like you are still having permissions issues.
Yes, it is trying to pull categories:
But this is failing because your API token does not have access to them. Please add the needed permissions to your API token and it should work fine.
from react-storefront.
Related Issues (20)
- Dependency resolution problems HOT 7
- Error while creating home page with fulfillAPIRequest HOT 3
- How to disable mock connector code HOT 3
- Please support saleor
- Search does not work (possible routing/API issue). HOT 3
- Is there a plan in the near future to upgrade Material UI to v5 ?
- Carousel component not passing arrows and dots classes down to the Arrows/Dots components
- Contact form broken and slack link on home page expired HOT 1
- Is the project abandoned ? HOT 6
- Add to Cart functionality issue
- Accessibility issue with Quantity Selector
- Latest version doesn't download with npm
- Upgrade docs to include steps for upgrading to latest version.
- Custom submit button component for SearchField
- How to pass translated hint texts for MagnifyHint
- Slack Invitation Expired.
- Connector Building Documentation looks Incomplete.
- Is this Project Dead? HOT 7
- Support for NextJS 13
- I cannot start the app using 'npm start' it shows 'Invalid hook call. Hooks can only be called inside of the body of a function component'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-storefront.