Hello I followed the Next JS quickstart
Hello, I followed the Next.JS quickstart to the letter (I think), running into error, please advise: Module not found: Can't resolve '../convex/_generated/api'
2 | import Image from 'next/image'
3 | import { useQuery } from "convex/react";
4 | import { api } from "../convex/_generated/api";5 | 6 | export default function Home() { 7 | const tasks = useQuery(api.tasks.get);
5 Replies
Which directory is this file in? You might need an additional
..
if you're not at the top level of app
directory.
You can also try out npm create convex@latest
, and follow the prompts to spin up a working Next.js project.Hello @Michal Srb, looks like the difference between my project and @Jamie was I was using /src, so that must be the issue.
I do have it setup as import { api } from "../convex/_generated/api"; in that project
with ".."
yep, so '../../' might fix it
Yes, that fixed it.
import { api } from "../../convex/_generated/api"