1

I am trying to use @iota/client package.

But on building react application I get this error:

/node_modules/@iota/client/out/lib/Client.js:1:2
1: MZ��!�☺L�!This program cannot be run in DOS mode.
     ^
2: $�uG

error during build:
Error: Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
    at error (file:////node_modules/rollup/dist/es/shared/rollup.js:1858:30)
    at Module.error (file:////node_modules/rollup/dist/es/shared/rollup.js:12429:16)
    at Module.tryParse (file:////node_modules/rollup/dist/es/shared/rollup.js:12806:25)
    at Module.setSource (file:////node_modules/rollup/dist/es/shared/rollup.js:12711:24)
    at ModuleLoader.addModuleSource (file:////node_modules/rollup/dist/es/shared/rollup.js:21959:20)  
1
  • Can you share your package.json and package-lock.json files? Does it help if you delete node_modules/@iota and run npm install again? Looks like your client.js is an EXE file instead of JavaScript... That does not happen for me.
    – mihi
    Commented Oct 1, 2023 at 20:50

1 Answer 1

0

@iota/client is deprecated. Please use the IOTA SDK.

About your error, the library uses WASM, which you will need to provide when using a bundler. See this guide how to do this for Rollup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.