ERROR: This program cannot be run in DOS mode.

Đang mở
#887 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
node.js, typescript
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với phần import password và mục optimizeDeps trong vite.config.ts, sau đó chạy bản build được báo cáo trên Windows 11 với Node v20.17.0. Theo dõi cách @node-rs/argon2 được xử lý trong quá trình build client; hoàn thành có nghĩa là dự án Qwik được cung cấp build và preview thành công mà không để Rollup parse tệp .node native.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Code:


import { Argon2id } from 'oslo/password';

/**
 * Hashes the password using Argon2id which is provided by the Oslo library
 * @param password - The password to hash
 * @returns The hashed password
 */
export const hashPassword = async (password: string) => {
  return new Argon2id().hash(password);
};

Error:

error during build:
[commonjs--resolver] node_modules/@node-rs/argon2-win32-x64-msvc/argon2.win32-x64-msvc.node (1:2): Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
file: C:/Users/User/Desktop/dashboard/node_modules/@node-rs/argon2/index.js:1:2

1: MZ����@���   �!�L�!This program cannot be run in DOS mode.
     ^
2: $z˰>w��>w��>w��76�2w��8���<w��8���/w��8���6w��8���:w��>w��Zw�����7w��S���?w��>w��<w��S���?w��S���?w��Rich>w...
3: `�0`@1��

RollupError: Unexpected character '�'
    at getRollupError (file:///C:/Users/User/Desktop/dashboard/node_modules/rollup/dist/es/shared/parseAst.js:392:41)
    at ParseError.initialise (file:///C:/Users/User/Desktop/dashboard/node_modules/rollup/dist/es/shared/node-entry.js:11494:28)
    at convertNode (file:///C:/Users/User/Desktop/dashboard/node_modules/rollup/dist/es/shared/node-entry.js:13192:10)
    at convertProgram (file:///C:/Users/User/Desktop/dashboard/node_modules/rollup/dist/es/shared/node-entry.js:12536:12)
    at Module.setSource (file:///C:/Users/User/Desktop/dashboard/node_modules/rollup/dist/es/shared/node-entry.js:14355:24)
    at async ModuleLoader.addModuleSource (file:///C:/Users/User/Desktop/dashboard/node_modules/rollup/dist/es/shared/node-entry.js:19046:13)
error: script "build.client" exited with code 1
error: script "preview" exited with code 1

vite.config.ts


export default defineConfig(({ command, mode }): UserConfig => {
  return {
   optimizeDeps: {
      exclude: [ "@node-rs/argon2" , "@node-rs/bcrypt"],
    },
...
}

Framework: Qwik
Node: v20.17.0
Windows 11 x64

Ngôn ngữ chính
Rust
Star
1.5k
Fork
52
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
14

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của napi-rs/node-rs

Tất cả issue của napi-rs/node-rs

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.