aws-amplify / amplify-backend

Home to all tools related to Amplify's code-first DX (Gen 2) for building fullstack apps on AWS
Apache License 2.0
161 stars 55 forks source link

Auto-detected frameworks detects Next.js with no Next.js app in monorepo #1585

Open tytremblay opened 3 months ago

tytremblay commented 3 months ago

Environment information

npm error could not determine executable to run
npm error A complete log of this run can be found in: /home/ty/.npm/_logs/2024-05-30T13_26_34_967Z-debug-0.log

Description

I do not have a Next.js app in my monorepo, Amplify Gen2 "auto-detects" Next.js whenever I select the app I want to deploy.

image

ykethan commented 3 months ago

Hey @tytremblay, thank you for reaching out. Does the repository have a amplify.yml file committed? Could you let us know the framework being used?

tytremblay commented 3 months ago

It does not. Is tha required?

I'm just trying to deploy a vanilla react app with an express backend

Jay2113 commented 3 months ago

@tytremblay while creating the app, did you select the checkbox for configuring the monorepo root directory for the react app? Also, do you have a next dependency within your package.json file? Can you share the package.json files?

Screenshot 2024-06-03 at 8 05 51 AM

The amplify.yml file by default is not required as the build settings are automatically detected by the Amplify Hosting service.

tytremblay commented 3 months ago

It looks like this is a caching issue? I just started trying to createa backend app for my monorepo and the form is already filled out for my frontend app that i've recently deployed: image

I've attached the package.json for my nx monorepo and the package.json for the backend library i just created.

ykethan commented 3 months ago

Hey @tytremblay, thank you for information. it does appear the package.json for the nx monorepo does contain both the react and next dependancies. Which the console appears to be defaulting to nextJS.

backend app for my monorepo and the form is already filled out for my frontend app

this is odd, could you provide us a screenshot of the monorepro repository?

Jay2113 commented 2 months ago

Hi @tytremblay 👋 , I was able to reproduce the outlined behavior with a Nx monorepo setup which consisted of React and Next.js apps. It seems that when a next dependency is included in the package.json file it takes precedence for framework detection. Thus, I am marking this as a bug.

In the meantime, as a workaround you can manually update the app's platform and framework as follows: