Has anyone ever seen an issue where seed seems una...
# help
n
Has anyone ever seen an issue where seed seems unable to build/deploy static site? I am able to run
npx sst build
+
npx sst deploy
locally and my app builds seemingly fine. So I imagine it is a setting in seed, but might be wrong 🤔 don't seem to be getting all to descriptive of an error message either so a bit stumped atm. Also currently trying to keep it simple to figure this out, so only have one stage (prod), no unit tests running, default region is same as local (ap-southeast-2) and only one stack with a couple endpoints + the frontend stack (see second screenshot)
f
Hey @Noah D from the error it looks like React cant find react scripts. Did you npm/yarn install the React app?
n
My package.json in the
frontend/web
directory does contain
react-scripts
Do i need to manually add a pre-build command or something for seed to download those dependencies?
Copy code
{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@ant-design/icons": "^4.6.3",
    "@craco/craco": "^6.2.0",
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "@types/jest": "^26.0.24",
    "@types/node": "^12.20.17",
    "@types/react": "^17.0.15",
    "@types/react-dom": "^17.0.9",
    "antd": "^4.16.12",
    "aws-amplify": "^4.2.5",
    "rc-menu": "^9.0.12",
    "react": "^17.0.2",
    "react-css-theme-switcher": "^0.3.0",
    "react-dom": "^17.0.2",
    "react-router-dom": "^5.2.0",
    "react-scripts": "4.0.3",
    "styled-components": "^5.3.1",
    "typescript": "^4.3.5",
    "web-vitals": "^1.1.2"
  },
  "scripts": {
    "start": "sst-env -- react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test"
  },
  "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": {
    "@serverless-stack/static-site-env": "^0.41.1",
    "@types/luxon": "^2.0.2",
    "@types/react-router-dom": "^5.1.8",
    "@types/styled-components": "^5.1.13",
    "autoprefixer": "^9.8.6",
    "eslint": "^7.31.0",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.24.0",
    "eslint-plugin-react-hooks": "^4.2.0",
    "gulp": "^4.0.2",
    "gulp-csso": "^4.0.1",
    "gulp-debug": "^4.0.0",
    "gulp-less": "^5.0.0",
    "gulp-postcss": "^9.0.0",
    "less-plugin-npm-import": "^2.1.0"
  }
}
f
If you are using yarn workspace and the frontend is one of the workspaces, then the dependencies would get installed.
Otherwise, you’d need to install it manually. One way of doing it is by adding a
before_build
hook via a buildspec - https://seed.run/docs/adding-a-build-spec
Let me know if that makes sense.
n
Yep! Managed to fix it now. Thanks for your assistance on this @Frank. Was just acting under the assumption it was an automatic thing as i have been going through that SST pdf, but i might have missed a bit tbh
j
Hey @Noah D, it should be at the top of this chapter https://serverless-stack.com/chapters/deploying-through-seed.html
Let me know if that works for you.
n
Hey Jay, yes I found that after 😅 missed it the first time round!