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

Vercel has a Chinese path problem #4408

Closed
4 tasks done
BlazeSnow opened this issue Dec 6, 2024 · 11 comments
Closed
4 tasks done

Vercel has a Chinese path problem #4408

BlazeSnow opened this issue Dec 6, 2024 · 11 comments
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@BlazeSnow
Copy link

Describe the bug

该问题似乎只出现于Google Chrome,使用Microsoft Edge时无法复现问题。Google Chrome的版本号为131.0.6778.109。

The issue appears to be specific to Google Chrome and does not appear to be repeated when using Microsoft Edge. The version number of Google Chrome is 131.0.6778.109.

使用vercel.com,当网页的路径中存在中文时,如:/cnpath/中文.html,网页会先报错404,刷新后报错500,显示MIDDLEWARE_INVOCATION_FAILED

Using vercel.com, when a Chinese character exists in the path of a webpage, such as /cnpath/中文.html, the webpage will first return an error of 404, then refresh and return an error of 500 with the message MIDDLEWARE_INVOCATION_FAILED.

1
2

Reproduction

https://blazesnow-vitepressissue.vercel.app/

https://github.com/BlazeSnow/VitepressIssue

Expected behavior

使用vercel.com,当网页的路径中存在中文时,不应报错404或500,而是像GitHub pages或Cloudflare pages一样正常显示。

With vercel.com, when there is Chinese in the path of a web page, it should not report an error of 404 or 500, but display normally like GitHub pages or Cloudflare pages.

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 4.21 GB / 15.69 GB
  Binaries:
    Node: 23.3.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (129.0.2792.65)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    vitepress: ^1.5.0 => 1.5.0

Additional context

No response

Validations

@BlazeSnow BlazeSnow added the bug: pending triage Maybe a bug, waiting for confirmation label Dec 6, 2024
@brc-dd
Copy link
Member

brc-dd commented Dec 6, 2024

Not sure seems to open fine for me on chrome too:

image

Check if some of your extensions are interfering.

@BlazeSnow
Copy link
Author

我禁用了所有的chrome插件,但是页面仍为404和500。

I disabled all chrome plugins, but the pages are still 404 and 500.

屏幕截图 2024-12-06 233151

@BlazeSnow
Copy link
Author

使用chrome的无痕模式时,问题不再复现。

When using chrome's Traceless mode, the problem does not recur.

屏幕截图 2024-12-06 233428

@brc-dd
Copy link
Member

brc-dd commented Dec 6, 2024

Hmm, can you try clearing your browser and dns cache? (Ctrl + Shift + R on page; for dns cache go to chrome://net-internals/#dns and click clear host cache)

It might be a temporary issue though. If you're using some VPN maybe try restarting it?

Can you check what happens if you run curl https://blazesnow-vitepressissue.vercel.app/cnpath/中文.html in terminal (powershell)?

@BlazeSnow
Copy link
Author

我重置了DNS和VPN,但是问题仍然出现,每次刷新时页面的错误ID也在变化。

I reset the DNS and VPN, but the problem still occurs and the error ID of the page changes with each refresh.

@BlazeSnow
Copy link
Author

StatusCode        : 200
StatusDescription : OK
Content           : <!DOCTYPE html>
                    <html lang="en-US" dir="ltr">
                      <head>
                        <meta charset="utf-8">
                        <meta name="viewport" content="width=device-width,initial-scale=1">
                        <title>中文 | BlazeSnow - VitepressIssue</ti...
RawContent        : HTTP/1.1 200 OK
                    Access-Control-Allow-Origin: *
                    Age: 1127
                    Content-Disposition: inline; filename="中æ.html"
                    Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
                    X-Vercel-Cache...
Forms             : {}
Headers           : {[Access-Control-Allow-Origin, *], [Age, 1127], [Content-Disposition, inline; filename="中æ.html
                    "], [Strict-Transport-Security, max-age=63072000; includeSubDomains; preload]...}
Images            : {}
InputFields       : {}
Links             : {@{innerHTML=Skip to content ; innerText=Skip to content ; outerHTML=<A class="VPSkipLink visually-
                    hidden" href="#VPContent" data-v-c8291ffa>Skip to content </A>; outerText=Skip to content ; tagName
                    =A; class=VPSkipLink visually-hidden; href=#VPContent; data-v-c8291ffa=}, @{innerHTML=<!--[--><!--]

                    --><!----><SPAN data-v-9f43907a>BlazeSnow - VitepressIssue</SPAN><!--[--><!--]-->; innerText=BlazeS
                    now - VitepressIssue; outerHTML=<A class=title href="/" data-v-9f43907a><!--[--><!--]--><!----><SPA
                    N data-v-9f43907a>BlazeSnow - VitepressIssue</SPAN><!--[--><!--]--></A>; outerText=BlazeSnow - Vite
                    pressIssue; tagName=A; class=title; href=/; data-v-9f43907a=}, @{innerHTML=<!--[--><SPAN data-v-815
                    115f5>Home</SPAN><!--]-->; innerText=Home; outerHTML=<A tabIndex=0 class="VPLink link VPNavBarMenuL
                    ink" href="/" data-v-afb2845e data-v-815115f5><!--[--><SPAN data-v-815115f5>Home</SPAN><!--]--></A>
                    ; outerText=Home; tagName=A; tabIndex=0; class=VPLink link VPNavBarMenuLink; href=/; data-v-afb2845
                    e=; data-v-815115f5=}, @{innerHTML=<!--[--><SPAN data-v-7eeeb2dc>test</SPAN><!--]-->; innerText=tes
                    t; outerHTML=<A class="VPLink link" href="/test/" data-v-7eeeb2dc><!--[--><SPAN data-v-7eeeb2dc>tes
                    t</SPAN><!--]--></A>; outerText=test; tagName=A; class=VPLink link; href=/test/; data-v-7eeeb2dc=}.
                    ..}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 12993

@brc-dd
Copy link
Member

brc-dd commented Dec 6, 2024

Check if you see any logs on Vercel -- Log in to vercel. Select your project. You'll see some navbar like this:

image

Click on live button:

image

When you have that page open, try re-visiting the page on Chrome.

@BlazeSnow
Copy link
Author

好像Vercel最近进行了更新,我看不到任何日志,包括代码为200的页面。

It seems that Vercel has been updated recently and I can't see any logs, including the page with code 200.

@BlazeSnow
Copy link
Author

我发现问题出现在进入网站的方式。作为网站的所有者,我是从vercel的部署界面点击链接进入网页,此时网页的路径有中文时,会出现404和500的报错;但是我删去Cookies,直接输入链接进入网页时,就不会出现以上问题。经过多次删去Cookies后不同进入网页的方式的测试,问题更可能出现在vercel的toolbar而不是vitepress。

I found that the problem was the way to access the site. As the owner of the website, I clicked the link to enter the page from the deployment interface of vercel. At this time, when the path of the page has Chinese, there will be 404 and 500 errors; However, when I delete the Cookies and enter the link directly to the web page, the above problem does not occur. After several tests of different ways of accessing web pages after deleting Cookies, the problem is more likely to occur in the toolbar of vercel than in vitepress.

@brc-dd
Copy link
Member

brc-dd commented Dec 13, 2024

Was this fixed? Maybe try contacting vercel support. VitePress itself doesn't create or register any middleware, it just generates pure HTML/CSS/JS.

@BlazeSnow
Copy link
Author

没解决,但是问题不是出现在vitepress,而是vercel toolbar。当我禁用了vercel toolbar后,页面都能正常显示了。

Not solved, but the problem is not with vitepress, but with vercel toolbar. After I disabled the vercel toolbar, the pages were displayed normally.

屏幕截图 2024-12-14 152709

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants