algorand / js-algorand-sdk

The official JavaScript SDK for Algorand.
https://algorand.github.io/js-algorand-sdk/
MIT License
285 stars 204 forks source link

Support for the experimental syntax ‘classProperties’ isn’t currently enabled #206

Closed vmandal closed 4 years ago

vmandal commented 4 years ago

Error in sdk version 1.7.0 ( It works fine if I use sdk 1.6.2 ) Error on importing sdk in react in file algosdk/src/client/v2/algod/models/types.js

./node_modules/algosdk/src/client/v2/algod/models/types.js SyntaxError: /home/Codes/Blockchain/Algorand/node-14/algo-blockchain-wallet/node_modules/algosdk/src/client/v2/algod/models/types.js: Support for the experimental syntax 'classProperties' isn't currently enabled (8:19):

6 | */ 7 | class DryrunRequest extends base.BaseModel {

8 | attribute_map = { | ^ 9 | "txns": "txns", 10 | "accounts": "accounts", 11 | "apps": "apps",

Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.

To reproduce .. create react app. Add to App.js

import React from 'react'; import algosdk from "algosdk";

function App() { return ( <> hello </> ); }

export default App;

npm: ‘6.14.7’ node: ‘12.16.0’ react: 16.13.1

jasonpaulos commented 4 years ago

Thanks for letting us know about this issue, I will look into it.