-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Using GPT Pilot with frontend frameworks
Senko Rašić edited this page Jan 28, 2024
·
1 revision
Currently, GPT Pilot works best with vanilla JavaScript on the frontend.
While you can still use a framework such as React, Vue or Angular, you may run into problems. This page is a work-in-progress to list the problems and workarounds.
You'll need to manually run create-react-app
(or create-next-app
) and tell it to create the project in the project root folder (not to create a sub-directory).
- When GPT Pilot asks you if it can run
npx create-react-app
, don't press/click anything yet; - Open the terminal and navigate to the root directory of your project (for example if your project is called
hello-world
, this would be/path/to/your/gpt-pilot/workspace/hello-world
) - Move
tests
,.gpt-pilot
and any other files or subdirectores (if they exist) to a temporary directory, such astmp
:ls -a # Any files/folders that appear in the list should be temporarily moved elsewhere, for example to /tmp mv tests /tmp mv .gpt-pilot /tmp
- Create the React/Next project (note the dot
.
here is important!):npx-create-react-app . # or npx create-next-app .
- When it is finished, go back to GPT Pilot and say/click "no" (so it doesn't try to execute the create command).