steemit / steem-js

Steem.js the official JavaScript library for Steem blockchain
https://www.npmjs.com/package/steem
MIT License
472 stars 225 forks source link

steem-js cannot be imported into typescript project but can with js project... #455

Open shawnpringle opened 4 years ago

shawnpringle commented 4 years ago

Expected behavior

'npm install steem --save' should result in being able to use it from both typescript or javascript.

Actual behavior

'npm install steem --save' doesn't even work. 'npm install https://github.com/steemit/steem-js -g --save' seems to work though until you actually run 'npm dev start' when it cannot find the steem object in SteemUserButton.js, however it can when it uses generic React without Typescript.

How to reproduce

Create a typescript skeleton add steem-js via npm as above and then add to App.tsx the following line: import 'steem';

Then run 'npm start dev'. It fails with "Module not found: Can't resolve 'steem' in 'D:\Source\steemfiles-ts-react\src".

I am using Brave and the github version "https://github.com/steemit/steem-js".

Windows 10

wehmoen commented 4 years ago

The npm package is called steem. Not steem-js: https://www.npmjs.com/package/steem