0

Am trying the App ID with React example from - https://www.ibm.com/cloud/blog/secure-your-single-page-react-apps-using-app-id. The following code snippet is giving error typeError: (0 , ibmcloud_appid_js__WEBPACK_IMPORTED_MODULE_0__.AppID) is not a function.

Am using React 18. Any suggestion on this?

const appID = useMemo(() => {
    return new AppID();
  }, []);

Am expecting the application to run without error and App ID should be able to intercept with logon request.

manas
  • 1
  • Not sure if you have looked here, but it is the official docs page on single page apps (SPA): https://cloud.ibm.com/docs/appid?topic=appid-single-page. The blog post above is from 2019. Likely that something has changed. Also, add more details to your question. – data_henrik May 04 '23 at 17:51
  • Is AppID react 18 compatible? Am using React 18 and AppID is giving error typeError: (0 , ibmcloud_appid_js__WEBPACK_IMPORTED_MODULE_0__.AppID) is not a function. – manas May 30 '23 at 04:27
  • Are you repeating your question...? I don't see that you added details like what package version you are using – data_henrik May 30 '23 at 06:09
  • I am using React 18 and ibmcloud-appid-js: ^1.0.1 version. – manas May 31 '23 at 12:21
  • and what Node / React versions? see https://stackoverflow.com/help/how-to-ask The idea is that someone else can read over your question above (no comments) and fully understand what you are asking, possibly even recreate the problem – data_henrik May 31 '23 at 14:20
  • Node version 18, React version 18 and ibmcloud-appid-js: ^1.0.1 version. To reproduce the issue try the React app mentioned in https://www.ibm.com/cloud/blog/secure-your-single-page-react-apps-using-app-id with Node version 18, React version 18 and ibmcloud-appid-js: ^1.0.1 version. – manas Jun 01 '23 at 06:12

0 Answers0