Skip to content

"unresolved libraries" error in Truffle migrations #482

Closed
@cgewecke

Description

@cgewecke

Opening and closing in case someone runs into this...

At synthetix 452, libraries were not linking as expected. Their migrations fn looked like:

module.export = async function(deployer, network, accounts){
  await deployer.deploy(LibA)

  deployer.link(LibA, ContractA); // Needs to be awaited
  await deployer.deploy(ContractA); 

  ...
}

For unknowns reasons when Truffle runs this in the plugin context the link method (which is technically async) needs to be awaited, otherwise there's a race-condition failure. Basically, this fixes...

await deployer.link(LibA, ContractA)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions