Bhanuvidh Mansinghani
Bhanuvidh Mansinghani

Reputation: 25

Getting: Could not detect any platform in the source directory. for Deploying React on Azure Static site

Im deploying on azure static web app but getting the error, which says: Could not detect any platform in the source directory. Error: Could not detect the language from repo.

i tried changing the app_location to /src but still showing could not detect the language from repo.

  # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
          app_location: "/src" # App source code path
          api_location: "" # Api source code path - optional
          output_location: "/build" # Built app content directory - optional

Upvotes: 2

Views: 3693

Answers (2)

Matthias M
Matthias M

Reputation: 14800

I've had the same issue with a pure html/js/css website without npm build.

Here this example helped for my case: https://github.com/staticwebdev/vanilla-basic/tree/main

I've done these steps:

  1. copied package.json + package-lock.json from that repo
  2. moved my files to the src folder

Then I could build my app-server via github action.

Upvotes: 0

Pravallika KV
Pravallika KV

Reputation: 8400

Glad @Bhanuvidh Mansinghani, that the given reference worked to resolve your issue.

I have found the similar issue from the GitHub of mslearn-staticwebapp repository that states could not detect the language from repository in static web app workflow.

Many customers faced the similar issue and fixed with the following steps:

  • Select the location and output folder for the application that is built for production environment and select custom option on step 5 instead of selecting the language.
  • Now, redeploy it after making the changes to existing one.
  • Also, check one of the workarounds given by the gcoines-uoc that to check the path of the application’s folder within the .yml file and had given the project folder structure based on hierarchy levels.

Upvotes: 1

Related Questions