taco is a friend of bluey π΅πΈπ΄
TTCTheo's Typesafe Cult
β’Created by taco is a friend of bluey π΅πΈπ΄ on 8/7/2023 in #questions
Why do I get this error? `Error: result.map is not a function`
Here is my code:
1 replies
TTCTheo's Typesafe Cult
β’Created by taco is a friend of bluey π΅πΈπ΄ on 8/5/2023 in #questions
Converting api data to a zod object
Hi. currently trying to build a lil poke app using the nextjs app directory, typescript, and zod. What's the quickest way to convert json to a zod object because the pokeapi data for ONE pokemon looks... scary
4 replies
TTCTheo's Typesafe Cult
β’Created by taco is a friend of bluey π΅πΈπ΄ on 10/22/2022 in #questions
Getting an error saying `TypeError movies.map is not a function`
import type { GetStaticProps, NextPage } from "next";
import MovieTypes from "../types/MovieTypes";
import MovieCard from "../components/MovieCard";
// type Props = {
// movies: MovieTypes[];
// };
const Home = ({ movies }: { movies: MovieTypes | any }) => {
return (
<div className="h-screen w-screen flex flex-col">
{movies.map((movie: MovieTypes) => (
<div
className="m-24 border p-4 border-lime-600 justify-center"
key={movie.id}
>
<MovieCard movies={movie} />
</div>
))}
</div>
);
};
export const getStaticProps: GetStaticProps = async () => {
const res = await fetch(
"https://api.themoviedb.org/3/movie/popular?api_key=KEY"
);
const movies = await res.json();
// console.log(results);
return {
props: {
movies,
},
};
};
export default Home;
9 replies
TTCTheo's Typesafe Cult
β’Created by taco is a friend of bluey π΅πΈπ΄ on 10/9/2022 in #questions
Just started trying to learn prisma through the docs and I'm getting an error
When I run "$ npx prisma migrate dev --name init", the terminal returns "Error: Couldn't find a datasource in the schema.prisma file"
10 replies