Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
322 stars 54 forks source link

Build Job fails #1085

Open satish84 opened 1 year ago

satish84 commented 1 year ago

works in vscode, but fails in github workflow. I'm using a basic react app

To Reproduce Steps to reproduce the behavior: Create and merge a PR Let the Azure static web app build and deploy job run

jobs: build_and_deploy_job: if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') runs-on: ubuntu-latest name: Build and Deploy Job steps:

Expected behavior Build job should succeed

Device info (if applicable): Ubuntu latest

Additional context These are the warn

npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin. npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.

I've tried to

  1. Manually update the dependencies locally as well as through a workflow file (e.g npm install -g svgo and others)
  2. Move React scripts to devdependencies
  3. Added overrides "overrides": { ---results in --> npm ERR! Override for svgo@^3.0.2 conflicts with direct dependency "svgo": "^3" }
  4. adding react to devDependencies

    "devDependencies": { "@svgr/plugin-svgo": "^6.5.1", "@svgr/webpack": "^6.5.1", "react-scripts": "^5.0.1", "rollup-plugin-terser": "^7.0.2", "sourcemap-codec": "^1.4.8", "stable": "^0.1.8", "svgo": "^3.0.2", "w3c-hr-time": "^1.0.2" },

  5. pull my hair out and about a million other things. Any help would be appreciated :-)
rupareddy5-21 commented 1 year ago

Hi @satish84 , can you please provide your logs with the errors that you are facing, your package.json and your app name so that we can look into the issue, thanks!

satish84 commented 1 year ago

thanks Rupa, got it working after adding

env:
       CI: false