nftstorage / nft.storage

**Notice: Uploads Decommissioned - Existing Data is Safe!** NFT.Storage Classic (classic.nft.storage) offers free decentralized storage and bandwidth for NFTs on IPFS and Filecoin. June 2024 Update: No new uploads, but all existing data is safe. Try the new NFT.Storage, which preserves data in long term Filecoin storage. Go to app.nft.storage
https://classic.nft.storage
Other
619 stars 167 forks source link

Failed to compile when using with ReactJS #289

Closed MikeHibbert closed 3 years ago

MikeHibbert commented 3 years ago

I installed the module using 'npm install nft.storage --save' to my ReactJS project and then ran 'npm start' to run the app and get the following error:

Failed to compile
./node_modules/nft.storage/src/lib.js 133:4
Module parse failed: Unexpected token (133:4)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|     const upload = transform(MAX_CONCURRENT_UPLOADS, async
|     /** @type {AsyncIterable<Uint8Array>} */
>     car => {
|       const carParts = [];
|

My project is written in ES7

alanshaw commented 3 years ago

I think this might be related to your Node.js version. What version are you running @MikeHibbert? Try v14 or ideally v16.

MikeHibbert commented 3 years ago

@alanshaw I'm using v14.2.0, that should be ok right?

I installed node v16.0.0 to with nvm and the error is the same

MikeHibbert commented 3 years ago

Ok! update!

When I remove the /* @type {AsyncIterable} / JSDoc from that line in src/lib.js it works fine!

hugomrdias commented 3 years ago

this was fixed in v3.0.2

thank you for the issue.