In module.hbs file in hydra-typegen package, there is an unused Codex import as: import { Codec } from "@polkadot/types/types";. This template file is being used to generate Events classes for each module inside query-node/mappings/generated/types/. The problem is if any event contains a param which is of codex type, then Codec is imported again, which leads to duplicate imports error while building the QN.
Problem
In module.hbs file in
hydra-typegen
package, there is an unused Codex import as:import { Codec } from "@polkadot/types/types";
. This template file is being used to generate Events classes for each module insidequery-node/mappings/generated/types/
. The problem is if any event contains a param which is of codex type, thenCodec
is imported again, which leads to duplicate imports error while building the QN.For example, in https://github.com/Joystream/joystream/pull/4517 the type of optional payment parameter in the MemberRemarked event is
Option<[AccountId32, u128] & Codec>
Solution
Remove unused
Codec
import from the template file.affects: @joystream/hydra-typegen