Articulation
Articulation3y ago

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
Michal Srb
Michal Srb3y ago
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.
Articulation
ArticulationOP3y ago
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 ".."
jamwt
jamwt3y ago
yep, so '../../' might fix it
Articulation
ArticulationOP3y ago
Yes, that fixed it.
Michal Srb
Michal Srb3y ago
import { api } from "../../convex/_generated/api"

Did you find this page helpful?