AI Code Suggestions
Some common things to note when working with the AI Code generation.
Known Issue | Troubleshooting | Status |
---|---|---|
Runtime Error: Failed to load resource: the server responded with a status of 404 (Not Found) :5123/app/invoke:1 Or Frontend Manager methods are not written as such. const CreateTaskAsync = (request: CreateTaskRequestDto): Promise<TaskDto> => ApiClient.invokeMethod<TaskDto>("Api", "TaskManager", "CreateTaskAsync", request); | The AI should not show these as suggested changes. Make sure the Manager Name is your manager name and the Service Name is “Api” Correct example: :5123/Api/invoke:1 Make changes to your manager to fix: import ApiClient from "./ApiClient" const CreateTaskAsync + (request: CreateTaskRequestDto): Promise<TaskDto> => ApiClient.invokeMethod<TaskDto>("Api", "TaskManager", "CreateTaskAsync", request); | Not Reported. |
‘AppConfiguration’ does not contain a definition for… | Copy and paste in error to chat box or add it to ask to add value to AppConfiguration. You will also need to add it to your appsettings.development.json file and the Environment in your Azure Static Web App (develop slot and production). | Not Reported. |
System.InvalidOperationException: Service ‘MyManager’ not found | Need to add MyManager and any other Managers, Engines, or Accessors to the dependency injection in Program.cs. Don’t forget to re-run the backend. | Not Reported. |
CS0104: ‘X’ is an ambiguous reference between ‘Namespace1.X’ and ‘Namespace2.X’ | The AI doesn’t take into consideration reserved keywords so avoid creating contracts with names like ‘task’. It will throw an ambiguous reference error. Rename the reserved keywords or have it specify a namespace. | Not Reported. |
NOTE: You don’t have to generate the frontend DTOs or managers, they will automatically be generated based on the backend DTOs. They should not show up as suggested changes, but should show up as changes in the review changes. If it doesn’t automatically generate you can click Ctrl + Shift + G to generate.
Focus Mode
Section titled “Focus Mode”Focus Mode helps you see only files that are relevant to the apps architecture.
Known Issue | Troubleshooting | Status |
---|---|---|
Focus Mode is missing: • Routes (react-app/src/routes_) • Frontend api folder (react-app/src/api) • .env (react-app) *git ignored • Appsettings.development.json (git ignored) • Program.cs (Services/App.Api) | Switch the toggle of focus mode and navigate to the file locations listed. | Not Reported. |
Hot Reloading
Section titled “Hot Reloading”When you make changes to your code the frontend will hot reload but the backend will require you to re-build and run.
NOTE: You need to stop and run whenever making backend changes.