hedera-reactjs-boilerplate icon indicating copy to clipboard operation
hedera-reactjs-boilerplate copied to clipboard

'hash-sdk' does not contain a default export

Open jDeppen opened this issue 3 years ago • 5 comments

Attempted import error: 'hash-sdk' does not contain a default export (imported as 'hash'). https://replit.com/@PabloPeillard1/hedera-reactjs-boilerplate

error

jDeppen avatar Aug 15 '21 19:08 jDeppen

Still facing this issue .Any Solution??

salik786 avatar Jan 03 '22 07:01 salik786

I'm also facing the same issue, anyone find the solution?

Talha089 avatar Jul 15 '22 06:07 Talha089

I went in and tried removing the hash implementation and just making direct hash-sdk function calls, and even after these errors there are errors regarding caseSensitive file names, 10,000+ files worth. looks like they didn't set a default export on hashgraph js sdk.

Slitherings avatar Aug 04 '22 08:08 Slitherings

@jDeppen @salik786 @Talha089 @Slitherings @publu import "hash" as a globle variable, because "hash" is not default exported in the child file of node_modules>hash-sdk>build>index.d.ts

=>use this

import * as hash from "hash-sdk";

iampankaj0 avatar Dec 08 '22 12:12 iampankaj0

I understand all the code in detail . The problem in this code is only one In hedera.ts file when you import the hask from hash-sdk it should import all with reference. Bingo you achieved.

Just write

Import * as hash from "hash-sdk";

This help you . Give feedback i will wait.

v-isha avatar Dec 09 '22 05:12 v-isha