azurereact-nativeazure-web-app-serviceexpo

How to deploy React Native web app using Expo in Node JS Azure - App Service


When I deploy the application in Azure with Visual Studio Code, I get the following error stack:

2020-10-28T20:34:32.249Z INFO - Initiating warmup request to container appdemo_xxxxxx for site appdemo_xxxxxx 2020-10-28T20:34:37.841Z ERROR - Container appdemo_xxxxxx for site appdemo_xxxxxx has exited, failing site start 2020-10-28T20:34:37.844Z ERROR - Container appdemo_xxxxxx didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging. 2020-10-28T20:34:37.874Z INFO - Stopping site appdemo_xxxxxx because it failed during startup.

The Plan de App Service is a SO Linux.

If I change start in package.json to "node index.js" work fine, but if I use this, not work:

 "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "test": "jest --watchAll"
  },

I have created the variables in Configuration -> App Settings PORT = 8080 and WEBSITES_PORT = 80

What am I doing wrong?


Solution

  • I found the solution for this error:

    1. Export the project from the VS terminal: expo build:web --no-pwa
    2. Transfer it using FTP to Azure
    3. Ready!