rstackjs / rstackjs/rsbuild-plugin-image-compress

rsbuild中使用@rsbuild/plugin-image-compress报错

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
25
Forks
2
Avg merge
2h 58m
Merged PRs (30d)
7

Description

  1. 计算机硬件信息:
    系统: windows10专业版
    版本号: 22H2
    操作系统内部版本: 19045.2728
    处理器: Intel(R) Core(TM) Ultra 5 235U 2.00 GHz
    系统类型: 64位操作系统,基于x64的处理器
  2. 包管理工具 bun V1.2.22
  3. "@rsbuild/core": "1.5.12",
    4 "@rsbuild/plugin-image-compress": "^1.3.1"
  4. 报错信息:
    Rsbuild v1.5.12
    error Failed to load file with jiti: D:\project\company\fleetview\config\rsbuild\build.config.mjs
    error Failed to build.
    error Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try npm i again after removing both package-lock.json and node_modules directory.
    at D:/project/company/fleetview/node_modules/@napi-rs/image/index.js:500:11
    at eval_evalModule (D:\project\company\fleetview\node_modules\jiti\dist\jiti.cjs:5:3522)
    at D:\project\company\fleetview\node_modules\jiti\dist\jiti.cjs:5:2502
    at async import (D:\project\company\fleetview\node_modules\jiti\dist\jiti.cjs:6:1734)
    at async D:/project/company/fleetview/node_modules/@rsbuild/plugin-image-compress/dist/index.js:3:14
    at async import (D:\project\company\fleetview\node_modules\jiti\dist\jiti.cjs:6:1734)
    at async D:/project/company/fleetview/config/rsbuild/build.config.mjs:2:28
    at async Function.import (D:\project\company\fleetview\node_modules\jiti\dist\jiti.cjs:6:1734)
    at async loadConfig_loadConfig (file:///D:/project/company/fleetview/node_modules/@rsbuild/core/dist/index.js:9517:28)
    at async init_loadConfig (file:///D:/project/company/fleetview/node_modules/@rsbuild/core/dist/index.js:9544:41)
    at async createRsbuild (file:///D:/project/company/fleetview/node_modules/@rsbuild/core/dist/index.js:7610:61)
    at async init_init (file:///D:/project/company/fleetview/node_modules/@rsbuild/core/dist/index.js:9562:117)
    at async CAC. (file:///D:/project/company/fleetview/node_modules/@rsbuild/core/dist/index.js:9687:31)
    error: script "build:dev" exited with code 1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the build:dev failure on Windows with @rsbuild/core 1.5.12, @rsbuild/plugin-image-compress 1.3.1, and Bun 1.2.22. Start at config/rsbuild/build.config.mjs and trace the plugin import into @napi-rs/image/index.js; done means the configuration loads and the development build completes without the native-binding error.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.