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

[Bug]: error: invalid utf-8 sequence of 1 bytes from index xxx #8006

Closed
littleprincewdk opened this issue Sep 27, 2024 · 1 comment · Fixed by #8009
Closed

[Bug]: error: invalid utf-8 sequence of 1 bytes from index xxx #8006

littleprincewdk opened this issue Sep 27, 2024 · 1 comment · Fixed by #8009
Assignees
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@littleprincewdk
Copy link

littleprincewdk commented Sep 27, 2024

System Info

System:
OS: macOS 14.5
CPU: (12) arm64 Apple M3 Pro
Memory: 138.08 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.20.3 - ~/.nvm/versions/node/v18.20.3/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v18.20.3/bin/yarn
npm: 10.7.0 - ~/.nvm/versions/node/v18.20.3/bin/npm
pnpm: 9.7.1 - ~/.yarn/bin/pnpm
Browsers:
Chrome: 129.0.6668.60
Safari: 17.5
npmPackages:
@rspack/cli: ^1.0.7 => 1.0.7
@rspack/core: ^1.0.7 => 1.0.7

Details

遇到了一个异常错误
image

src/bad.js 有非 utf8 字符,rspack buildin:swc-loader 不能处理,但是 webpack 或 swc-loader 是可以的。如果我只是在 vscode 里保存下这个文件(不做任何修改)后(src/good.js),buildin:swc-loader 也可以了。对比发现非 utf8 字符被 vscode 替换成了 "efbfbd",即 替代字符 (U+FFFD)
image
image

希望 buildin:swc-loader 像 babel/swc 一样去兼容一下

复现代码:rspack-project.zip

Reproduce link

No response

Reproduce Steps

  1. pnpm install
  2. prpm run dev

Tasks

No tasks being tracked yet.
@littleprincewdk littleprincewdk added bug Something isn't working pending triage The issue/PR is currently untouched. labels Sep 27, 2024
@cjnoname
Copy link

Same for character ©

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants