I'm trying to publish the my sveltekit 1.0 application on the azure app service which runs fine locally on my machine with npm run preview.
When I publish the build folder and try to access the published sit I get error. I will really appreciate your response on this as I have stuck on this from long time. This is my build folder structure. I have set node build as a startup command in my app. I used node 18 LTS and Linux. I have tried using both port 3000 and 8080 by setting it in the configuration tab. But getting same error for both of them.
T
2023-03-28T16:33:59.021Z INFO - Starting container for site
2023-03-28T16:33:59.023Z INFO - docker run -d --expose=8080 --name cal-med-emr_0_a507fee4 -e PORT=8080 -e WEBSITE_SITE_NAME=cal-med-emr -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=cal-med-emr.azurewebsites.net -e WEBSITE_INSTANCE_ID=db3f3781635e5140d0607cce3dbb8c4be6e04b9cc61c46d779039e60d16e0789 -e WEBSITE_USE_DIAGNOSTIC_SERVER=True appsvc/node:16-lts_20230228.2.tuxprod node build
2023-03-28T16:33:59.024Z INFO - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2023-03-28T16:34:01.176Z INFO - Initiating warmup request to container cal-med-emr_0_a507fee4 for site cal-med-emr
2023-03-28T16:34:00.630914840Z _____
2023-03-28T16:34:00.630996242Z / _ \ __________ _________ ____
2023-03-28T16:34:00.631019542Z / /\ \__ / | _ __ _/ __ \
2023-03-28T16:34:00.631024343Z / | / /| | /| | /\ ___/
2023-03-28T16:34:00.631028743Z _| /_____ _/ || ___ >
2023-03-28T16:34:00.631033343Z / / /
2023-03-28T16:34:00.631037743Z A P P S E R V I C E O N L I N U X
2023-03-28T16:34:00.631041943Z
2023-03-28T16:34:00.631045943Z Documentation: http://aka.ms/webapp-linux
2023-03-28T16:34:00.631050043Z NodeJS quickstart: https://aka.ms/node-qs
2023-03-28T16:34:00.631054143Z NodeJS Version : v16.19.0
2023-03-28T16:34:00.631058343Z Note: Any data outside '/home' is not persisted
2023-03-28T16:34:00.631062443Z
2023-03-28T16:34:01.764430099Z Starting OpenBSD Secure Shell server: sshd.
2023-03-28T16:34:01.942340340Z Starting periodic command scheduler: cron.
2023-03-28T16:34:01.995411846Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2023-03-28T16:34:01.996273466Z Could not find operation ID in manifest. Generating an operation id...
2023-03-28T16:34:01.996292666Z Build Operation ID: d9815e3f-0a9a-4d43-9c95-42986298b2d5
2023-03-28T16:34:02.273322453Z Environment Variables for Application Insight's IPA Codeless Configuration exists..
2023-03-28T16:34:02.333966130Z Writing output script to '/opt/startup/startup.sh'
2023-03-28T16:34:02.463879778Z Running #!/bin/sh
2023-03-28T16:34:02.463945679Z
2023-03-28T16:34:02.463953380Z # Enter the source directory to make sure the script runs where the user expects
2023-03-28T16:34:02.463959280Z cd "/home/site/wwwroot"
2023-03-28T16:34:02.463964680Z
2023-03-28T16:34:02.463969880Z export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2023-03-28T16:34:02.463975080Z if [ -z "$PORT" ]; then
2023-03-28T16:34:02.463987880Z export PORT=8080
2023-03-28T16:34:02.463993781Z fi
2023-03-28T16:34:02.463998781Z
2023-03-28T16:34:02.465101706Z PATH="$PATH:/home/site/wwwroot" node build
2023-03-28T16:34:02.966109976Z node:internal/modules/cjs/loader:998
2023-03-28T16:34:02.966149577Z throw err;
2023-03-28T16:34:02.966157277Z ^
2023-03-28T16:34:02.966170577Z
2023-03-28T16:34:02.966176478Z Error: Cannot find module '/home/site/wwwroot/build'
2023-03-28T16:34:02.966181778Z at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
2023-03-28T16:34:02.966186878Z at Function.Module._load (node:internal/modules/cjs/loader:841:27)
2023-03-28T16:34:02.966192178Z at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2023-03-28T16:34:02.966212378Z at node:internal/main/run_main_module:22:47 {
2023-03-28T16:34:02.966217778Z code: 'MODULE_NOT_FOUND',
2023-03-28T16:34:02.966222579Z requireStack: []
2023-03-28T16:34:02.966227479Z }
2023-03-28T16:34:03.550Z ERROR - Container cal-med-emr_0_a507fee4 for site cal-med-emr has exited, failing site start
2023-03-28T16:34:03.582Z ERROR - Container cal-med-emr_0_a507fee4 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2023-03-28T16:34:03.643Z INFO - Stopping site cal-med-emr because it failed during startup.
I will really appreciate your help on this.