[SOLVED] CORS policy error

@dincho.chain sure
So compiling and testing at Contracts Aepp

contract MapTest =

record state = { tMap : map(int, int) }

stateful entrypoint init() = { tMap = {} }

entrypoint getMapPositive(index: int) =
state.tMap[index = 5]

entrypoint getMapNegative(index: int) =
state.tMap[index = -5]

The weird thing is that getMapPositive(8) returns 5 as expected, but getMapNegative(8) returns: Unknown error and in the browser console I get:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://latest.compiler.aepps.com/decode-call-result. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

@dincho.chain is this going to be resolved?

I’m looking into it right now, looks like HTTP compiler issue to me that throws 500 error, not directly related to CORS.

See Exception error: {encode_expr_todo,'-'} · Issue #59 · aeternity/aesophia_http · GitHub

thanks! :slight_smile: i will use my local full node in the meantime, just for the community in general i think it is very useful that online IDE works properly, as people can start experimenting with sophia right away ^^

There is no doubt that we should have easy to use tools (and properly working) to onboard new developers

Hey, this nasty issue makes me wanna cry already @dincho.chain

Access to XMLHttpRequest at 'https://compiler.aepps.com/decode-call-result' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

seems @ulfnorell resolved the issue? Says new commit for ACI on github

It should be fixed in latest version at latest.compiler.aepps.com some time ago already

Yes, now maybe @botanicalcarebot.chain can help coordinate a release of the http compiler

so it still wont work in IDE until http compiler is released and deployed?

Hey @botanicalcarebot.chain, can you please update this thread when resolved? Thank you.

Will do. The fix is work in progress.

2 Likes

I’ll use this topic as this is somehow related:

This is an error coming from the SDK.

any updates on the fix progress? tnx

the recent errors should be gone now, can you verify @CryptoTask @kraykov ?

no, negative values still dont work

Right, the fix is merged but we haven’t released yet. Will be done soon. I’ll update here.

3 Likes

Short update here: the release is done, waiting for deployment. @dincho.chain can provide the final update once that is done.

3 Likes

Sorry for the long delay, HTTP compiler 4.3.0 has been deployed.

Reachable by header param, or at https://latest.compiler.aepps.com

4 Likes

@CryptoTask @kraykov Please check if that works.