tangle-network / relayer

🕸️ The Webb Relayer Network
https://webb-tools.github.io/relayer/
Apache License 2.0
22 stars 13 forks source link

[Issue] Fix dynamic importing issue of fixture file #484

Closed salman01zp closed 1 year ago

salman01zp commented 1 year ago

Description

After updagrading to node v18 , typescript package and other deps to latest, it seems to be have introduced some bug which causes following issue

   /home/runner/work/relayer/relayer/tests/solidity-fixtures/vanchor_2/2/witness_calculator.cjs:263
export {};
^^^^^^

SyntaxError: Unexpected token 'export'
      at internalCompileFunction (node:internal/vm:73:18)
      at wrapSafe (node:internal/modules/cjs/loader:1176:20)
      at Module._compile (node:internal/modules/cjs/loader:1218:27)
      at Module.m._compile (node_modules/ts-node/src/index.ts:1618:23)
      at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
      at Object.require.extensions.<computed> [as .js] (node_modules/ts-node/src/index.ts:1621:12)
      at Module.load (node:internal/modules/cjs/loader:1117:32)
      at Function.Module._load (node:internal/modules/cjs/loader:958:12)
      at Module.require (node:internal/modules/cjs/loader:1141:19)
      at require (node:internal/modules/cjs/helpers:110:18)
      at /home/runner/work/relayer/relayer/tests/node_modules/@webb-tools/utils/lib/utils.js:83:99
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

Solution

Restore yarn.lock file and add package one by one to check which package is causing issue

salman01zp commented 1 year ago

I restored yarn.lock file and started updating packages and found out that upgrading typescript package from 4.6.2 to 5.0.4 is causes above issue. I have not figuredexact root issue but downgrading typescript to 4.6.2 works