My build step fails when running the following github action. Note that I'm using yarn v1.22.19.
yml (abbreviated):
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v3
- run: yarn install && yarn run build
When the above action runs, I get the below error (abbreviated).
Run yarn run build
yarn run v1.22.19
$ tsc && vite build
Version 5.3.3
tsc: The TypeScript Compiler - Version 5.3.3
COMMON COMMANDS
//shortened
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.
How do I avoid the above error? I've recently switched from npm to yarn and from CRA to Vite, if it matters.
.yarnrc.yml:
compressionLevel: mixed
enableGlobalCache: true
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-1.22.19.cjs
package.json: (has some unnecessary scripts left from testing)
{
"name": "myproject",
"version": "0.1.0",
"type": "module",
"private": true,
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@fontsource/roboto": "^4.5.8",
"@mui/icons-material": "^5.10.16",
"@mui/material": "^5.10.16",
"@reduxjs/toolkit": "^1.9.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.2.0",
"dotenv": "^16.3.1",
"env-cmd": "^10.1.0",
"firebase": "^10.7.1",
"firebase-tools": "^13.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5",
"react-router-dom": "^6.4.3",
"redux-thunk": "^2.4.2",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"build:staging": "env-cmd -f .env.staging npm run build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"preci": "rm -rf node_modules",
"ci": "yarn install --frozen-lockfile",
"setfbproj": "firebase use --clear --project='myproject'"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@redux-devtools/core": "^3.13.1",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.56.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"redux-devtools-extension": "^2.13.9",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite-tsconfig-paths": "^4.2.2"
},
"packageManager": "[email protected]"
}
User error, I had missed to commit tsconfig, which caused my WIP project to fail to build.