0

I have a small ReactJS (using TypeScript) application that builds and runs locally no problem. It uses Vite to build and run the app locally. Works just fine.

But when building in Azure DEvOps for deployment as an Azure Static Web App I get the following compilation error:

x Build failed in 642ms
error during build:
Could not resolve "../../Api/SomeApi" from "src/pages/SomeFolder/MyPage.tsx"
file: /working_dir/src/pages/SomeFolder/MyPage.tsx
    at getRollupError (file:///working_dir/node_modules/rollup/dist/es/shared/parseAst.js:396:41)
    at error (file:///working_dir/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at ModuleLoader.handleInvalidResolvedId (file:///working_dir/node_modules/rollup/dist/es/shared/node-entry.js:20212:24)
    at file:///working_dir/node_modules/rollup/dist/es/shared/node-entry.js:20172:26

The import from "../../Api/Identity" looks like:

import { HttpResponse, XResponse, YResponse, ZCreateRequest, AResponse, UserType, AUpdateRequest } from "../../Api/SomeApi";

(names change to protect the guilty)

The Azure DevOps pipeline task for the static web app build looks like:

  - task: AzureStaticWebApp@0
    inputs:
      azure_static_web_apps_api_token: $(AZURE_STATIC_WEB_APPS_API_TOKEN_WORDY_WORD_0F24ECA0F)
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
      app_location: "/" # App source code path
      api_location: "" # Api source code path - optional
      output_location: "build" # Built app content directory - optional
###### End of Repository/Build Configurations ######

I have no clue why the oryx tool fails to build the app. There does not appear to be a way to install the oryx tool on my dev machine (lots of documentation about the commands you can issue... just not a single word about how to install the dang thing).

Any help would be appreciated.

4
  • If Possible, Share your Repository? Commented Jan 17 at 14:57
  • Cannot share repository. Commented Jan 17 at 15:51
  • If you are using Vite with ReactJS, then change the output_location to dist. Commented Jan 20 at 8:14
  • I am using Vit and ReactJS (ts). Changing the output_location did not affect the compile error. Thanks though. Commented Jan 20 at 13:22

1 Answer 1

0

Fixed. The underlying issue was case-sensitive folder names. In windows "../../Api/Whatever" is the same as "../../api/Whatever". In Linux... nope. "Api" and "api" are separate and distinct.

Thanks everyone for your time!!

Thanks to our tireless DevOps engineers for spotting this.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.