Search
Star
Feedback
Setup for Free
Β© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Getting an error saying `TypeError movies.map is not a function` - Theo's Typesafe Cult
TTC
Theo's Typesafe Cult
β’
4y ago
β’
8 replies
taco is a friend of bluey π΅πΈπ΄
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
;
Theo's Typesafe Cult
Join
26,131
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
TypeError: resolver is not a function
TTC
Theo's Typesafe Cult / questions
3y ago
TypeError: queryClient.getMutationDefaults is not a function
TTC
Theo's Typesafe Cult / questions
3y ago