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

Issues with Aptos Integration - unable to build/run #1462

Open
UiCandy opened this issue Dec 26, 2024 · 2 comments
Open

Issues with Aptos Integration - unable to build/run #1462

UiCandy opened this issue Dec 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@UiCandy
Copy link

UiCandy commented Dec 26, 2024

Describe the bug

SyntaxError: The requested module '@aptos-labs/ts-sdk' does not provide an export named 'PrivateKey'
Tried on a host of 0.1.6 alphas and 0.1.7-alpha

To Reproduce

Run pnpm build/start

Expected behavior

Should run or skip this part if no .env variable is found.

Screenshots

Screenshot 2024-12-26 at 3 38 48 PM
@UiCandy UiCandy added the bug Something isn't working label Dec 26, 2024
@UiCandy
Copy link
Author

UiCandy commented Dec 29, 2024

Am I the only one facing this issue? Tried with the latest v0.1.7-alpha.2 build and still facing the same issue.
The version before the Aptos integration works as expected.
Screenshot 2024-12-29 at 11 23 11 AM

@AIFlowML
Copy link
Contributor

AIFlowML commented Jan 3, 2025

Hello mate. Are you stil stuck in this ?
Let us know

Here some tips

Comprehensive Solution

1. TLDR (Executive Summary)

  • Issue Essence: SyntaxError due to missing PrivateKey export in @aptos-labs/ts-sdk.
  • Root Cause: PrivateKey is not exported in versions 0.1.6-alpha and 0.1.7-alpha.
  • Solution Approach: Verify exports, adjust imports, handle deprecation warnings, and ensure Node.js compatibility.
  • Impact Assessment: Blocks build process and requires code adjustments.

2. Quick Resolution Path

  • Immediate Steps:

    1. Verify Exports: Check @aptos-labs/ts-sdk documentation or source code for available exports.
    2. Adjust Imports: Modify the import statement in transfer.ts:
      import { Account, Aptos, AptosConfig, Ed25519PrivateKey, PrivateKeyVariants } from "@aptos-labs/ts-sdk";
    3. Handle Deprecation Warnings:
      • Replace --experimental-loader with register().
      • Update fs.Stats usage as per Node.js documentation.
    4. Check Node.js Compatibility: Ensure Node.js v23.3.0 is compatible with the SDK.
  • Validation Commands:

    npm run build
    npm test
  • Rollback Procedures:

    • Revert import changes if issues persist.
    • Use a previous Node.js version if compatibility issues arise.

3. Comprehensive Solution

  • Detailed Technical Analysis:

    • The SyntaxError is due to the absence of PrivateKey in the SDK exports.
    • Deprecation warnings indicate future compatibility issues.
  • Step-by-Step Implementation:

    1. Verify Exports: Confirm available exports in @aptos-labs/ts-sdk.
    2. Adjust Imports: Update import statements to match available exports.
    3. Handle Deprecation Warnings: Update code to use recommended practices.
    4. Check Node.js Compatibility: Ensure the Node.js version is compatible with the SDK.
    5. Consult Community or Support: Seek further assistance if needed.
  • Dependencies and Side Effects:

    • Ensure all dependencies are up to date.
    • Test thoroughly to catch any side effects.
  • Configuration Changes:

    • Update Node.js configuration to use register() instead of --experimental-loader.
  • Environment Requirements:

    • Ensure Node.js v23.3.0 or compatible version is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants