-
Notifications
You must be signed in to change notification settings - Fork 22
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
Make running test app easier #117
Comments
Thanks @johnboxall for raising this issue, we've created a work item in our backlog to track this work |
I tried the steps above again but it appears no longer possible to get the test app to successfully run. First I build the lib: nvm use 18
corepack enable
yarn install
yarn run renderTemplates
yarn build:lib Second I tried to run the app: NODE_OPTIONS=--openssl-legacy-provider HTTPS=true react-scripts start The cert that shipped with the older version of CRA we use appears to not be compatible with modern Node versions so I introduced a new flag. Though I was able to get it to start (and bypass the TLS warning with In addition I needed to make the following changes:
Going forward, I think we have a few options:
All of this might be easier when SCAPI ships support for CORS (removing the need for a proxy) which should come up in B2C Commerce ~24.10-ish. Until then, an easy-ish way to test this library is to use npx pwa-kit-create-app --outputDir pwa-kit-2 Now edit this file: |
commerce-sdk-isomorphic
ships with a neat little test app based on[email protected]
It is challenging to get the app working.
thisisunsafe
.package.json
, providing a valid shortcode.src/config.js
needs to be updated with valid values.https://localhost:3000/callback
be a valid redirect URI.authorize
will be followed, and CRA doesn't know how to render/callback
:commerce-sdk-isomorphic/src/static/helpers/slasHelper.ts
Lines 140 to 145 in 414ff58
It is possible to jump through these hoops, but challenging:
A few ideas:
commerce-sdk-isomorphic/package.json
Line 39 in 414ff58
authorize
helper to be more forgiving. We do care if the initial call toauthorizeCustomer
failed, but in the event that we're running in a browser, we actually do not care if we followed a redirect and the redirect failed to load, as we can still get the usid/code out of the URL, regardless of the status code of loadingredirect_uri
.The text was updated successfully, but these errors were encountered: