ps-serverless-app icon indicating copy to clipboard operation
ps-serverless-app copied to clipboard

TypeError: Cannot read properties of undefined (reading 'apiEndpoint')

Open trxrse12 opened this issue 2 years ago • 2 comments

Hi Dave,

first of all a big Thank You for your work !!! best in class!!!

Trying to start the webapp (on "Implementing Serverless Web Application Hosting and Delivery on AWS") on the p1 branch, I get:

Module.<anonymous>
src/services/index.js:5
  2 | import createAuthRefreshInterceptor from 'axios-auth-refresh';
  3 | import { Auth } from 'aws-amplify';
  4 | 
> 5 | const SERVICES_HOST = window.appConfig.apiEndpoint;
  6 | let client;
  7 | 
  8 | /* eslint-disable no-console */
View compiled
./src/services/index.js
http://localhost:3000/static/js/main.chunk.js:3459:30
__webpack_require__
/home/trxrse/projects/ps-serverless-app/webapp/webpack/bootstrap:856
  853 | 
  854 | __webpack_require__.$Refresh$.init();
  855 | try {
> 856 | 	modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  857 | } finally {
  858 | 	__webpack_require__.$Refresh$.cleanup(moduleId);
  859 | }

Any idea?

Thanks Remus

trxrse12 avatar Nov 07 '22 18:11 trxrse12

The appconfig tools require the value from a deployment bucket, which is not present in a "yarn start" environment. Hence it maybe could detect it's running in that environment.

mike-whittaker-work avatar May 19 '23 10:05 mike-whittaker-work

I am also facing the same issue, any workaround? @davidtucker

binayakgourishankar avatar Feb 17 '24 06:02 binayakgourishankar