No 'Access-Control-Allow-Origin' header is present on the requested resource

Hi there

I have an InvoiceNinja Self-Hosted v5.5.14.

I have two different URLs for InvoiceNinja, erp.example.com for Admin access and cp.example.com for the client portal. After setting the APP_URL to https://cp.example.com in .ENV file, I am getting the following error:

Access to fetch at ‘https://cp.example.com/canvaskit/canvaskit.wasm’ from origin ‘https://erp.example.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

If I go to https://cp.example.com, it is loading the client portal without any issues.

Is it possible to have a separate URL for the admin and client portal?

Thank you

Hi,

@david any thoughts? If possible it may help to only set the path in the canvaskit setting rather than the full URL.

Thank you, @david and @hillel

The Issue has been resolved after setting the path for canvasKitBaseUrl instead URL.

1 Like

I’m experiencing a similar issue.

I have billing.mydomain.com and also an alias domain billing.mydomain.net.au pointing to my invoiceninja install.

billing.mydomain.com works fine but billing.mydomain.net.au produces this CORS policy error and doesn’t load certain elements, such as the logo. @hillel @david Any thoughts?

v5.7.33-C125

Screenshot 2023-10-23 004717

Anyone? Should I raise an issue about this one?

I’m not sure if this configuration is supported with the web app, is the desktop app working?

Yes the desktop app works. I have moved my domain from x.net.au to x.au. In order to respect links that clients have received from Invoice Ninja in their email, I have configured invoice ninja for x.au but also set up the alias domain .net.au for this reason, however I get the issue mentioned above. This might not affect the client portal…I haven’t fully checked yet but I’m concerned certain elements won’t load properly under the .net.au.

Is there no real workaround for this scenario?

@david are you aware of a solution?

I can’t think of options for this off the top of my head.