Ironclad / rivet

The open-source visual AI programming environment and TypeScript library
https://rivet.ironcladapp.com
MIT License
2.76k stars 242 forks source link

[Bug]: Origin tauri://localhost is not allowed by Access-Control-Allow-Origin. Status code: 204 #153

Open vibl opened 1 year ago

vibl commented 1 year ago

What happened?

I get a CORS error when I send an HTTP request (same error from browser or Node.js).

[Error] Origin tauri://localhost is not allowed by Access-Control-Allow-Origin. Status code: 204
[Error] Fetch API cannot load https://api-prod.omnivore.app/api/graphql due to access control checks.

The same query works from Postman and curl.

The server probably rejects "origin: tauri://localhost".

(I tested with https://mockbin.com that this is not this bug: https://github.com/tauri-apps/tauri/issues/2327);

See also https://github.com/Ironclad/rivet/issues/28

What was the expected functionality?

HTTP

Describe your environment

Kubuntu 23.04 rivet_1.2.1_amd64.AppImage

Relevant log output

No response

Relevant screenshots

No response

Code of Conduct

abrenneke commented 1 year ago

Are you sure this is happening with the Node.js executor @vibl? Because node doesn't make preflight requests or check CORS in any way.

vibl commented 1 year ago

It does when the executor is set on "Node", but I now realize that the popup "Remote Debugger (Reconnecting...)" stays up, which probably mean that the executor has not really switched to Node.

Also, when it is set to "Node", the Executor dropdown flickers and there are flashes of the word "Remote" appearing for a 100ms or so (alternating with "Node").

abrenneke commented 1 year ago

Yeah the UI for the node executor needs to be improved, definitely. If it never actually connects, then you're right, the node executor isn't starting successfully. Are you running from source or from a compiled version?

abrenneke commented 1 year ago

If you're running from source, you can actually run the node executor and connect to it manually:

vibl commented 1 year ago

I'm running from the compiled version but I will try from source.