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

ssr是不是重复请求了 #2

Closed
lmy1991 opened this issue Oct 9, 2022 · 14 comments
Closed

ssr是不是重复请求了 #2

lmy1991 opened this issue Oct 9, 2022 · 14 comments

Comments

@lmy1991
Copy link

lmy1991 commented Oct 9, 2022

image
如上图所示,刷新的情况下是不是不应该在次请求接口

@xuxinyuancode
Copy link
Contributor

本来是不应该再次请求的,这样相当于请求了两边,但如果不这样做的话会导致如文章调转到工具的时候不会发起新的请求,因此我才这样做的,属于无奈之举,当时用的是nuxt3-rc3,不知道是否有解决的方案。

@lmy1991
Copy link
Author

lmy1991 commented Oct 26, 2022

我试了一下目前的rc12。封装了一个fetch是可以正常单边正常调用

@yuanquan8
Copy link

更新到rc12以后,tailwind CSS 在开发的时候就无法热更新css了,需要把打包方式从vite修改成webpack才行,有点坑了

@xuxinyuancode
Copy link
Contributor

等我回头试试请求可以省掉不能,rc11中tailwind就不能热更新了

@yuanquan8
Copy link

不能热更新这个问题,是个bug吧,我换成unocss也是无法进行热更新

@xuxinyuancode
Copy link
Contributor

我rc11,也不能热更新

@yuanquan8
Copy link

我rc11,也不能热更新

我升级到rc12后,使用unocss,终于可以热更新了,css的语法规则依旧是使用tailwind。

@yuanquan8
Copy link

我rc11,也不能热更新

不要升级rc12,我升级rc12后,部署生产环境,使用Nginx反向代理,访问变得很慢,但是如果直接通过端口访问没有这个问题。降级到rc11也没有这个问题。

@xuxinyuancode
Copy link
Contributor

那我还是不要升级了

@yuanquan8
Copy link

那我还是不要升级了

@xuxinyuancode
This can be done by adding the following configuration
#8575

export default defineNuxtConfig({
  ...
  experimental: {
    writeEarlyHints: false,
  },
  ...
})

@yuanquan8
Copy link

是因为nuxt 3 rc12中,默认开启了103状态码(103 early hints ),但是Nginx目前还不支持这个状态码,所以才会导致这个问题出现,目前的解决方案是在Nuxt配置文件中,将experimental.writeEarlyHints设置为false。

@yuanquan8
Copy link

是因为nuxt 3 rc12中,默认开启了103状态码(103 early hints ),但是Nginx目前还不支持这个状态码,所以才会导致这个问题出现,目前的解决方案是在Nuxt配置文件中,将experimental.writeEarlyHints设置为false。

103 early hints详解:click on me

@xuxinyuancode
Copy link
Contributor

实在是太新了

@yuanquan8
Copy link

实在是太新了

rc版本不是很稳定,每个版本都有不同的bug

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

No branches or pull requests

3 participants