Using with create react app
what is the propper way to use with CRA? https://docs.convex.dev/client/react/quickstart-create-react-app
Module not found: Error: You attempted to import ../convex/_generated/api which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
Create-React-App Quickstart | Convex Developer Hub
Add Convex to a Create React App project
12 Replies
If you follow the guide, the convex directory should be inside of your
src/
directory
Looks like you have it in repository rootwhat am i missing?
The
convex
directory is supposed to be inside of the src
directory
I'd suggest deleting your my-app
directory and walking through the instructions again. I've just confirmed that if you follow the instructions, your convex
directory will end up inside of your src
directory.i also did it from scratch after your first message, will try again
looks like i have to select "new project" from the cli. as exiting project didn't set it up right
oh interesting
looks to work now
trying with an existing project
i manually added the file generated from the new path
then moved my code into and that seemed to do it
at least it seems to 🤞
Confirmed, first run of
npx convex dev
in a CRA app generates src/convex/
if a new convex project is created, but generates convex/
, if an existing project is selected.Ah interesting. I'll file file an internal bug to investigate. Thanks for raising this!
Thanks for reporting, nate; and for reproing, erquhart!