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

When using @docusaurus/faster, if there is some Chinese in the md file when packaging on version 3.6, an error message will be displayed, such as byte index 4 is not a char boundary. #10646

Open
5 of 7 tasks
EaveLuo opened this issue Nov 6, 2024 · 4 comments · Fixed by web-infra-dev/rspack#8368
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@EaveLuo
Copy link

EaveLuo commented Nov 6, 2024

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

● Client ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ (83%) sealing chunk ids
Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message: byte index 4 is not a char boundary; it is inside '点' (bytes 3..6) of 站点建设-7-fa-065
Location: crates\rspack_core\src\utils\compile_boolean_matcher.rs:325

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1: napi_register_module_v1
at
2: napi_register_module_v1
at
3: napi_register_module_v1
at
4: napi_register_module_v1
at
5: wasmer_vm_f64_nearest
at
6: wasmer_vm_f64_nearest
at
7: napi_register_module_v1
at
8: napi_register_module_v1
at
9: napi_register_module_v1
at
10: napi_register_module_v1
at
11: napi_register_module_v1
at
12: napi_register_module_v1
at
13: napi_register_module_v1
at
14: napi_register_module_v1
at
15: napi_register_module_v1
at
16: napi_register_module_v1
at
17: napi_register_module_v1
at
18: napi_register_module_v1
at
19: napi_register_module_v1
at
20: napi_register_module_v1
at
21: napi_register_module_v1
at
22: napi_register_module_v1
at
23: napi_register_module_v1
at
24: napi_register_module_v1
at
25: napi_register_module_v1
at
26: napi_register_module_v1
at
27: wasmer_vm_f64_nearest
at
28: napi_register_module_v1
at
29: napi_register_module_v1
at
30: napi_register_module_v1
at
31: BaseThreadInitThunk
at
32: RtlUserThreadStart
at
error Command failed with exit code 3221226505.

Reproducible demo

No response

Steps to reproduce

1.upgrade to 3.6.0
2.copy these to docusaurus.config.ts :
future: {
experimental_faster: {
swcJsLoader: true,
swcJsMinimizer: true,
swcHtmlMinimizer: true,
lightningCssMinimizer: true,
rspackBundler: true,
mdxCrossCompilerCache: true,
},
},
3.start or build
4.error happened

Expected behavior

package correctly and then start.

Actual behavior

I suspect there is a problem with the byte compilation of Chinese when packaging.

Your environment

  • Public source code:https://github.com/EaveLuo/eave-web
  • Public site URL:eaveluo.com
  • Docusaurus version used:3.6.0
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):Edge Latest, Node.js 20.12.2
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):windows10

Self-service

  • I'd be willing to fix this bug myself.
@EaveLuo EaveLuo added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Nov 6, 2024
@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Nov 6, 2024
@slorber
Copy link
Collaborator

slorber commented Nov 6, 2024

Thanks for reporting.

I don't think it's related to Chinese because our Chinese site builds fine:
https://docusaurus.io/zh-CN/

What makes you think it's related to Chinese chars? Have you tried replacing those with non-Chinese chars and it fixed the issue?

Have you tried turning some of the Docusaurus Faster flags off one by one and see if it works better?

It looks like an Rspack bug, like the error message reports. cc @hardfist

@EaveLuo
Copy link
Author

EaveLuo commented Nov 6, 2024

Thank you for reply.
I tried to delete the Chinese characters at the position where he reported the error, and then it would not report an error at this position, and then it would report errors about other Chinese characters, similar to next:

Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message: byte index 2 is not a char boundary; it is inside '后' (bytes 0..3) of 后端-403-60d
Location: crates\rspack_core\src\utils\compile_boolean_matcher.rs:325

@slorber
Copy link
Collaborator

slorber commented Nov 6, 2024

I see thanks.

We also have @ruibaby that reported a similar issue, also involving Chinese characters apparently:
#10556 (comment)

@hardfist any idea if there's already a Rspack bug report for that?

I found a few possibly related links:

@hardfist
Copy link

hardfist commented Nov 6, 2024

I see thanks.

We also have @ruibaby that reported a similar issue, also involving Chinese characters apparently: #10556 (comment)

@hardfist any idea if there's already a Rspack bug report for that?

I found a few possibly related links:

thanks for reporting, we will take a look ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants