Amplify hosting production builds work, but not previews

0

App ARN arn:aws:amplify:us-east-1:568579195889:apps/d3ulmammbfkz6s

I've attached the build logs from the preview - it's complaining about a missing NPM package (which is definitely defined in the package.json). The production build was able to successfully install it and build the app. The preview however couldn't.

I'm hosting a Nextjs app (with SSR) in a turborepo monorepo using npm workspaces.

                                 # Starting phase: preBuild
2023-03-29T07:11:45.431Z [INFO]: # Executing command: npx npm install
2023-03-29T07:11:57.111Z [INFO]: added 346 packages, and audited 355 packages in 11s
2023-03-29T07:11:57.117Z [INFO]: 96 packages are looking for funding
                                 run `npm fund` for details
                                 1 moderate severity vulnerability
                                 To address all issues, run:
                                 npm audit fix
                                 Run `npm audit` for details.
2023-03-29T07:11:57.141Z [INFO]: # Completed phase: preBuild
                                 # Starting phase: build
                                 # Executing command: npx turbo run build --filter=blender
2023-03-29T07:11:58.010Z [WARNING]: npm
2023-03-29T07:11:58.011Z [WARNING]: WARN exec The following package was not found and will be installed: turbo@1.8.6
2023-03-29T07:11:59.065Z [INFO]: • Packages in scope: blender
                                 • Running build in 1 packages
                                 • Remote caching disabled
2023-03-29T07:11:59.065Z [INFO]: types:build: cache miss, executing a9da055a7c02e257
2023-03-29T07:11:59.401Z [INFO]: types:build:
                                 types:build: > types@1.0.0 build
                                 types:build: > tsc
                                 types:build:
2023-03-29T07:12:00.287Z [INFO]: types:build: src/types/request.ts(1,27): error TS2307: Cannot find module 'firebase/firestore' or its corresponding type declarations.
2023-03-29T07:12:00.289Z [INFO]: types:build: src/types/user.ts(1,27): error TS2307: Cannot find module 'firebase/firestore' or its corresponding type declarations.
2023-03-29T07:12:00.295Z [INFO]: types:build: npm ERR! Lifecycle script `build` failed with error:
                                 types:build: npm ERR! Error: command failed
2023-03-29T07:12:00.295Z [INFO]: types:build: npm ERR!   in workspace: types@1.0.0
                                 types:build: npm ERR!   at location: /codebuild/output/src974571710/src/apps/packages/types
2023-03-29T07:12:00.300Z [WARNING]: types:build: ERROR: command finished with error: command (/codebuild/output/src974571710/src/apps/packages/types) npm run build exited (1)
2023-03-29T07:12:00.300Z [WARNING]: command (/codebuild/output/src974571710/src/apps/packages/types) npm run build exited (1)
                                    ERROR  run failed: command  exited (1)
2023-03-29T07:12:00.301Z [INFO]: Tasks:    0 successful, 1 total
                                 Cached:    0 cached, 1 total
                                 Time:    1.637s
2023-03-29T07:12:00.311Z [ERROR]: !!! Build failed
2023-03-29T07:12:00.311Z [INFO]: Please check the supported SSR features to find if your build failure is related to an unsupported feature: https://docs.aws.amazon.com/amplify/latest/userguide/ssr-Amplify-support.html#supported-unsupported-features. You may also find this troubleshooting guide useful: https://docs.aws.amazon.com/amplify/latest/userguide/troubleshooting-ssr-deployment.html
2023-03-29T07:12:00.312Z [ERROR]: !!! Non-Zero Exit Code detected
2023-03-29T07:12:00.312Z [INFO]: # Starting environment caching...
2023-03-29T07:12:00.312Z [INFO]: # Environment caching completed
Terminating logging...

Enter image description here Enter image description here

preguntada hace un año62 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas