Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON - Kevin Powell - Community
KP-C
Kevin Powell - Community
•
2y ago
•
35 replies
anes039
SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON
const ProfileEditPage
=
(
)
=
>
{
useEffect
(
(
)
=
>
{
fetch
(
'
/edit
'
)
.then
(response
=
> response
.json
(
)
)
.then
(data
=
> console
.log
(data
)
)
.catch
(err
=
> console
.error
(err
)
)
;
}
,
[
]
)
index
.js
(file
)
import express from
'express
'
;
import cors from
'cors
'
;
app
.use
(cors
(
)
)
;
const app
= express
(
)
;
const PORT
= 5173
;
app
.listen
(PORT
,
(
)
=
> console
.log
(
Server is running on ${PORT}
Server is running on ${PORT}
)
)
;
app
.get
(
'
/edit
'
,
(req
, res
)
=
>
{
const users
=
[
{
name
:
'Anes
'
,
age
: 19
,
}
,
{
name
:
'Dion
'
,
age
: 17
,
}
]
res
.json
(users
)
;
}
)
export default app
;
Kevin Powell - Community
Join
A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.
36,263
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Unexpected token is not valid JSON
KP-C
Kevin Powell - Community / back-end
2y ago
JSON.parse unexpected error
KP-C
Kevin Powell - Community / back-end
3y ago
Unexpected end of json input
KP-C
Kevin Powell - Community / back-end
3y ago