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

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

Open
Klafaa opened this issue Sep 2, 2024 · 0 comments
Open

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

Klafaa opened this issue Sep 2, 2024 · 0 comments

Comments

@Klafaa
Copy link

Klafaa commented Sep 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant