-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
algosdk is a CommonJS module #216
Comments
I'm getting the same issue, but not on typescript, and with Next Js as well |
i fixed my issue by upgrading the nextjs and changing the filesystem structure before it was not using the src folder, so i moved everything to src updated a lot of other configs (eg tailwind, typescript..) and it seems to work now basically i moved from /pages/index.tsx to /src/app/page.tsx which fixed the issue |
I am encountering the same error in SolidStart. I believe that the issue can be resolved with a small change here: - import { Algodv2 } from 'algosdk'
+ import algosdk from 'algosdk'
+ const { Algodv2 } = algosdk |
This commit changes the import of `Algodv2` from `algosdk` to use the default import syntax. This resolves a SyntaxError in consuming apps that use CommonJS modules. Closes #216
After upgrade from v2 to v3 of the use-wallet I have started to receive error:
SyntaxError: Named export 'Algodv2' not found. The requested module 'algosdk' is a CommonJS module, which may not support all module.exports as named exports.
we are using the nextjs with typescript, i have checked that the algosdk is correctly installed (2.8.0), i have tried to downgrade it, i have tried to reinstall the node modules...
the error originates in the use wallet lib.. for the record i can use
import { Algodv2 } from "algosdk";
in my projecti have checked the example project here and dont see any typescript difference.. https://github.com/TxnLab/use-wallet/blob/main/examples/nextjs/tsconfig.json
anybody has faced the same issue before?
The text was updated successfully, but these errors were encountered: