Skip to content

Conversation

@luojiyin1987
Copy link
Contributor

@luojiyin1987 luojiyin1987 commented Jul 16, 2025

PR-25 PR-25 PR-25 Powered by Pull Request Badge

Checklist(清单):

  • Labels
  • Assignees
  • Reviewers

Closes #XXXXX

@luojiyin1987
Copy link
Contributor Author

我复用了 ../components/Layout/PageHead 这个 PageHead 组件

@luojiyin1987
Copy link
Contributor Author

on-recoverable-error.js:29 Uncaught Error: Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:

- A server/client branch `if (typeof window !== 'undefined')`.
- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

https://react.dev/link/hydration-mismatch

  ...
    <PathnameContextProviderAdapter router={{sdc:{},sbc:{}, ...}} isAutoExport={false}>
      <CustomApp pageProps={{}} language="zh-CN" languageMap={{...}} Component={{...}} err={undefined} ...>
        <Head>
        <Navbar>
        <div className="mt-5 pt-2">
          <Container className="py-5">
            <div ref={null} className="py-5 conta...">
              <PageHead>
              <h1>
              <p>
              <p>
              <h2>
              <p>
              <p>
              <ProgressBar className="mb-3" variant="info" now={10} label={undefined}>
                <div ref={null} className="mb-3 progress">
                  <div ref={null} role="progressbar" className="progress-b..." style={{width:"10%"}} aria-valuenow={10} ...>
-                   第 1 步
              ...
        ...
      ...

    at eval (license-filter.tsx:108:7)
    at CustomApp.render (_app.tsx:67:13)
image

直接搬过来的代码有 水合报错(Hydration )。 @TechQuery

@TechQuery
Copy link
Member

on-recoverable-error.js:29 Uncaught Error: Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:

- A server/client branch `if (typeof window !== 'undefined')`.
- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

https://react.dev/link/hydration-mismatch

  ...
    <PathnameContextProviderAdapter router={{sdc:{},sbc:{}, ...}} isAutoExport={false}>
      <CustomApp pageProps={{}} language="zh-CN" languageMap={{...}} Component={{...}} err={undefined} ...>
        <Head>
        <Navbar>
        <div className="mt-5 pt-2">
          <Container className="py-5">
            <div ref={null} className="py-5 conta...">
              <PageHead>
              <h1>
              <p>
              <p>
              <h2>
              <p>
              <p>
              <ProgressBar className="mb-3" variant="info" now={10} label={undefined}>
                <div ref={null} className="mb-3 progress">
                  <div ref={null} role="progressbar" className="progress-b..." style={{width:"10%"}} aria-valuenow={10} ...>
-                   第 1 步
              ...
        ...
      ...

    at eval (license-filter.tsx:108:7)
    at CustomApp.render (_app.tsx:67:13)

直接搬过来的代码有 水合报错(Hydration )。 @TechQuery

@luojiyin1987 已确认是“翻译函数无法被 Next.js Page router 序列化传输”所致,建议先用“步数文字改百分号”的方法绕过。

@TechQuery TechQuery added the feature New feature or request label Jul 16, 2025
@TechQuery TechQuery changed the title Feat/license filter [add] Class version of License Filter Jul 16, 2025
@github-project-automation github-project-automation bot moved this from Ready to In review in 官网项目群 Jul 16, 2025
@TechQuery TechQuery merged commit ff061ac into Open-Source-Bazaar:main Jul 16, 2025
1 check failed
@github-project-automation github-project-automation bot moved this from In review to Done in 官网项目群 Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants