Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] error - SyntaxError: Unexpected token u in JSON at position 0 #863

Closed
2 tasks done
hponiang opened this issue Apr 17, 2023 · 4 comments · Fixed by #870
Closed
2 tasks done

[Bug] error - SyntaxError: Unexpected token u in JSON at position 0 #863

hponiang opened this issue Apr 17, 2023 · 4 comments · Fixed by #870

Comments

@hponiang
Copy link

hponiang commented Apr 17, 2023

反馈须知

请在下方中括号内输入 x 来表示你已经知晓相关内容。

  • 我确认已经在 常见问题 中搜索了此次反馈的问题,没有找到解答;
  • 我确认已经在 Issues 列表(包括已经 Close 的)中搜索了此次反馈的问题,没有找到解答。

描述问题
error - SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
error - SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
error - SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
error - SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()

如何复现
yarn dev 访问后没有反应,服务器报错 报错

截图
请在此提供控制台截图、屏幕截图或者服务端的 log 截图。

一些必要的信息

  • 系统:[比如 windows 10/ macos 12/ linux / android 11 / ios 16]
  • 浏览器: [比如 chrome, safari]
  • 版本: [填写设置页面的版本号]
  • 部署方式:[比如 vercel、docker 或者服务器部署]
@hponiang
Copy link
Author

系统:[比如 windows 10 ]
浏览器: [比如 chrome, ]
版本: [V1.9.8]
部署方式:[比 服务器部署]

@hponiang hponiang changed the title [Bug] [Bug] error - SyntaxError: Unexpected token u in JSON at position 0 Apr 17, 2023
@Yidadaa
Copy link
Collaborator

Yidadaa commented Apr 17, 2023

  1. 确保 nodejs 版本升级到 18
  2. 使用 yarn start 启动服务
  3. 建议使用 docker 部署,别手动编译

@Yidadaa Yidadaa closed this as completed Apr 17, 2023
@wxjun2018
Copy link

执行yarn build报类似错误:

info - Creating an optimized production build
info - Compiled successfully
info - Linting and checking validity of types
info - Collecting page data
[ ] info - Generating static pages (0/4)SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at U (E:\gpt\ChatGPT-Next-Web\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.edge.production.min.js:22:53)
at c (E:\gpt\ChatGPT-Next-Web\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.edge.production.min.js:24:307)
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at U (E:\gpt\ChatGPT-Next-Web\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.edge.production.min.js:22:53)
at c (E:\gpt\ChatGPT-Next-Web\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.edge.production.min.js:24:307)
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at U (E:\gpt\ChatGPT-Next-Web\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.edge.production.min.js:22:53)
at c (E:\gpt\ChatGPT-Next-Web\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.edge.production.min.js:24:307)
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at U (E:\gpt\ChatGPT-Next-Web\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.edge.production.min.js:22:53)
at c (E:\gpt\ChatGPT-Next-Web\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.edge.production.min.js:24:307)

Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at U (E:\gpt\ChatGPT-Next-Web\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.edge.production.min.js:22:53)
at c (E:\gpt\ChatGPT-Next-Web\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.edge.production.min.js:24:307)
info - Generating static pages (4/4)

Export encountered errors on following paths:
/page: /
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS E:\gpt\ChatGPT-Next-Web>

@jaw52
Copy link
Contributor

jaw52 commented Apr 17, 2023

升级next版本解决windows本地开发问题,具体看#870

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants