Principal this is not a constructor

I’ve raised many questions, observations, and issues about SNS.yaml and the CreateServiceNervousSystem proposal this weekend, so there’s no reason not to document the ones I find and fix myself.

So when providing fallbackControllerPrincipalIds to @dfinity/nns I get following error:

TypeError: this is not a constructor
    at fromText (chunk-GURPV5CO.js?v=adf4f374:738:23)
    at Array.map (<anonymous>)
    at Ui (@dfinity_nns.js?v=7b572303:2288:226)
    at er (@dfinity_nns.js?v=7b572303:2330:80)
    at cr (@dfinity_nns.js?v=7b572303:2433:115)
    at makeProposal (@dfinity_nns.js?v=7b572303:2753:16)
    at makeProposal (icp-proposal.api.ts:102:9)
    at async submitProposal (proposal.services.ts:108:22)
    at async submitProposal (submit.services.ts:432:34)
    at async HTMLFormElement.onSubmit (SubmitReview.svelte:45:19)

Fixed in PR: https://github.com/dfinity/ic-js/pull/671

Root cause of the issue is Principal.fromText which be passed as a function for a mapper.
Don’t know if it never worked or if doesn’t work anymore. Nevertheless above PR fixes it.

1 Like