Skip to content
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

appId fails in production build with CRA #39

Open
johnjesse opened this issue Jun 1, 2020 · 2 comments
Open

appId fails in production build with CRA #39

johnjesse opened this issue Jun 1, 2020 · 2 comments
Assignees

Comments

@johnjesse
Copy link

using Create-React-App (CRA) and bringing in import AppID from 'ibmcloud-appid-js works fine when running a dev build. But when running a production build (via npm run build) and serving the files - appID breaks - somewhere after signin the token gets lost. My guess is something is happening in the minification process of the build.

To work around it I'm loading appId directly from the CDN. I don't know exactly what CRA is doing for a prod build in it's webpack config - but surely the appId js file should be resilient against that.

@math1esen
Copy link

  • 1 this was quite difficult to track down. Thanks for the tip with using the cdn. However, would be nice with a fix to the npm package import.

@lenzch
Copy link

lenzch commented Nov 21, 2020

Same here for our Angular application. Dev build works fine, but production build is broken.

It fails with: Invalid token
at t.exports.decodeAndValidate
at t.exports.retrieveTokens
at async t.exports.performOAuthFlowAndGetTokens

Although the token that is retrieved is valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants