Search code examples
node.jsdockerhyperledger-fabrichyperledgerhyperledger-composer

Issue in starting/upgrading composer network: Unexpected token const


I have a multi-org fabric setup which runs along with composer server. Things work quite fine normally. However, infrequently I face this issue while starting/upgrading my network:

running start.js
SyntaxError: Unexpected token const at eval (eval at compile (/usr/local/src/node_modules/composer-runtime/lib/scriptcompiler.js:99:33), :3:13) at ScriptCompiler.compile (/usr/local/src/node_modules/composer-runtime/lib/scriptcompiler.js:99:100) at Function.newInstance (/usr/local/src/node_modules/composer-runtime/lib/installedbusinessnetwork.js:41:56) at Function.start (/usr/local/src/node_modules/composer-runtime-hlfv1/lib/composer.js:41:77) at at process._tickCallback (internal/process/next_tick.js:188:7) at Function.Module.runMain (module.js:686:11) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3

I am not able to figure out the reason due to which this issue comes. All the transaction processor functions were working just fine and there was no issue. However, out of a sudden, this issue has come.

What I have tried:

  • First, I thought this was an issue with the docker images of peer and chaincode cc-env. So, I removed all my docker images related to hyperledger fabric 1.1 and downloaded them afresh. But this did not help.
  • Then I removed node modules related to Hyperledger Composer and deleted entire node runtime from my system and downloaded it afresh. But this did not help either.

Versions I'm using:

  • Hyperledger Fabric: 1.1
  • Hyperledger Composer: 0.19.13
  • Node: 8.9.4

Any references or guidance will help.


Solution

  • Are you using ES6 features in your chaincode? I don't think Composer supports it.