question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello, I’m trying to execute the code bellow:

config = {
      net: 'TestNet',
      script: Neon.create.script({
        scriptHash: 'de1a53be359e8be9f3d11627bcca40548a2d5bc1',
        operation: 'registerMailbox',
        args: [
          Neon.u.reverseHex(Neon.u.str2hexstring(neoWallet.getPublicKey(true))),
          Neon.u.reverseHex(Neon.u.str2hexstring('some string'))
        ]
      }),
      address: neoWallet.address,
      privateKey: neoWallet.privateKey,
      gas: 0
    };

    Neon.doInvoke(config).then(res => {
      console.log(res.response);
    });

And am getting errors like:

Request header field timeout is not allowed by Access-Control-Allow-Headers in preflight response.

Any idea?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
snowypowerscommented, May 13, 2018

sorry, there was some issue with publishing. It should be available now.

As for your question, there is no such type as Address for contract param. I guess that is where it went wrong. You should be using a bytearray to pass the address in. I would try Neon.sc.ContractParam.byteArray(neoWallet.address, 'address')

0reactions
mhugginscommented, Nov 14, 2018

This issue occurs sporadically depending on the endpoint selected by neon-js. I’ve run into this as well. I haven’t dug into it, but I suspect it’s either an issue with specific endpoint versions, or with the server setup around that endpoint.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cross-Origin Resource Sharing (CORS) - MDN Web Docs
Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, ...
Read more >
Cross-origin resource sharing - Wikipedia
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be requested from another domain outside the...
Read more >
What is CORS (cross-origin resource sharing)? - PortSwigger
Cross-origin resource sharing (CORS) is a browser mechanism which enables controlled access to resources located outside of a given domain. It extends and...
Read more >
Cross-Origin Resource Sharing (CORS) - web.dev
The browser's same-origin policy blocks reading a resource from a different origin. This mechanism stops a malicious site from reading ...
Read more >
CORS Enabled - W3C Wiki
CORS is a specification that enables truly open access across domain boundaries. Why is CORS important? Currently, client-side scripts (e.g., JavaScript) are ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found