Skip to content

ERROR: This program cannot be run in DOS mode. #887

@Klafaa

Description

@Klafaa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions