[SOLVED] Fiat Onramp: (Function Moralis.initPlugins not working)

Hey Moralis Team,

i was following Ivans tutorial on the new fiat onramp plugins. was copying the code, unfortunately it throws the following error(s):

after posting the issue in discord/troubleshooting i ran the following commands npm install react, react-dom , moralis , moralis-react & vanillajs. nothing worked unfortunately.

Appreciate your help once again!


    <title>Vanilla Boilerplate</title>
	  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/web3.min.js"></script>
    <script src="https://npmcdn.com/[email protected]/dist/moralis.js"></script>

    <button id="btn-login" onclick="dumpFiat()">Dump Fiat</button>
    <iframe id="myIframe" src="" width = "350" height="650" style ="display:none"></iframe> <br>

      // connect to Moralis server
      Moralis.serverURL = "https://qejutygvunvz.moralisweb3.com:2053/server";

      (async function init(){
        await Moralis.initPlugins();

     function dumpFiat(){

     async function iframefiat(){
      let result = await Moralis.Plugins.fiat.buy( undefined, {disableTriggers: true});
      document.getElementById("myIframe").style.display = "block";
      document.getElementById("myIframe").src = result.result.data;

I’ve noticed the same thing.
I’m now watching this thread too for a response.

1 Like

Works fine for me with latest Moralis SDK, as in instead of

   <script src="https://npmcdn.com/[email protected]/dist/moralis.js"></script>

I used:

    <script src="https://npmcdn.com/[email protected]/dist/moralis.js"></script>
1 Like