English 中文(简体)
申请错误:出现客户-当事人之间的例外(IN NEXT,JS 13)
原标题:Application error: a client-side exception has occurred(IN NEXT,JS 13)

Introduction:

I m目前从事气象应用。 我在Next.js 13的帮助下,在完成这个项目之后,在当地机器中建造了<<>strong>项目,但该项目在家网页上安装,但我的动态路线没有工作。

https://github.com/1741Rishabh/weather-Appication”rel=“nofollow noreferer” 编码Link

local system Outcome:

Front page

“在此处的影像描述”/</a

dynamic page

“entergraph

vercel Outcome

Front page vercel

“enterography

dynamic page in vercel (error)

enter image description here

问题回答

如果Vercel没有标识,就不可能确定哪些错误,但至少是:getCityId使用 localhost<>/code>获取数据:

const getcityid = async (id) => {
    const city = await fetch(`http://localhost:3000/api/citibyid?id=${id}`)
    const citydata = await city.json();
    return citydata
}

你们需要使用相对的道路,例如:

const city = await fetch(`/api/citibyid?id=${id}`)

还确保环境变量<代码>API_KEY在Vercel上设定开放式一览表。

...Try full dynamic page with adding export const dynamic = force-dynamic ; to the ..location/[city] /page.js ( and basically remove next: {revalidate: 10000} from fetches) -- maybe issues re caused by inconsistencies btw server-prerendered (which should be the default city?) and dynamically rendered on the fly [city] pages ... (also, why not to set title=${cityreport.city.name} Weather - Next Weather Apptometadata` object itself (as by docs) ...





相关问题
How to make Sequelize use singular table names

I have an model called User but Sequelize looks for the table USERS whenever I am trying to save in the DB. Does anyone know how to set Sequelize to use singular table names? Thanks.

What is Node.js? [closed]

I don t fully get what Node.js is all about. Maybe it s because I am mainly a web based business application developer. What is it and what is the use of it? My understanding so far is that: The ...

Clientside going serverside with node.js

I`ve been looking for a serverside language for some time, and python got my attention somewhat. But as I already know and love javascript, I now want learn to code on the server with js and node.js. ...

Can I use jQuery with Node.js?

Is it possible to use jQuery selectors/DOM manipulation on the server-side using Node.js?

How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...