ardriveapp / turbo-sdk

The first SDK on Arweave to bring you programmable fiat top ups, Turbo-powered upload reliability, and fast data and indexing finality for TypeScript based Web and Node projects.
https://ardrive.io/turbo/
Apache License 2.0
30 stars 1 forks source link

can not init turboAuthClient with @ardrive/turbo-sdk/web #199

Open EurekaChen opened 3 weeks ago

EurekaChen commented 3 weeks ago

Describe the bug can not init TurboAuthClient in svelte. error: Uncaught (in promise) TypeError: import_arweave.default.init is not a function

To Reproduce code:

<script lang="ts">  
    import {TurboFactory,developmentTurboConfiguration} from '@ardrive/turbo-sdk/web';
    import Arweave from 'arweave/web';

    async function publish(){       
        console.log("begin");
        const arweave = new Arweave({});
        const jwk = await arweave.wallets.generate();               
        const turboAuthClient = TurboFactory.authenticated({privateKey:jwk,...developmentTurboConfiguration});      
    }       
</script>
<h1>Error</h1>
<button onclick={publish}>publish</button>

click publish and get error:

@ardrive_turbo-sdk_web.js:283175 
 Uncaught (in promise) TypeError: import_arweave.default.init is not a function
    at new ArweaveToken (@ardrive_turbo-sdk_web.js:283175:54)
    at Object.arweave (@ardrive_turbo-sdk_web.js:319333:24)
    at _TurboFactory.getAuthenticatedTurbo (@ardrive_turbo-sdk_web.js:319844:81)
    at _TurboFactory.authenticated (@ardrive_turbo-sdk_web.js:320116:32)
    at HTMLButtonElement.publish (+page.svelte:9:40)
dtfiedler commented 3 weeks ago

Hi @EurekaChen, thanks for the bug report. Can you share your package.json as well as any gist or repos that can help us understand your project setup? That'll help us understand what could be causing the issue. Appreciate your patience!

EurekaChen commented 3 weeks ago

ok, thank you! package.json I have back sdk from 1.92.2 to 1.6.1, still have error.

EurekaChen commented 3 weeks ago

help

dtfiedler commented 3 weeks ago

@EurekaChen - can you try recently released v1.20.1?