2

I am trying to run sap ui5 application inside docker.The docker final command runs the script in package.json as "dock": "ui5 serve -o index.html --accept-remote-connections", But when running this am getting the following error

Process Failed With Error Error Message: Cannot read properties of undefined (reading 'status').

Appreciate any help on this.

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
user846445
  • 221
  • 1
  • 3
  • 14
  • 1
    As the error states the value or object being read doesn't have any status value on which possibly you are doing some calculation. So, its throwing an error. Is it working fine without docker ? – innocent Oct 08 '22 at 08:18

2 Answers2

0

Check if your application has a code similar to this fix:

if (error.response.status === 404) {

Replace it with:

if (error.response && error.response.status === 404) {
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Try the following command instead and see what the output is:

ui5 serve --accept-remote-connections --verbose

Without context, your error could be caused by many things. The above command should provide more information, which can help you identifying the cause.

Typically you also do not want to use the -o (or --open) flag in docker. It will attempt to launch a browser, which is often not available in a docker container. This might cause issues too.

Reference: https://sap.github.io/ui5-tooling/pages/CLI/#ui5-serve

RandomByte
  • 57
  • 9