Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS issue since v2 #1952

Closed
marc-on-github opened this issue Apr 21, 2023 · 9 comments
Closed

CORS issue since v2 #1952

marc-on-github opened this issue Apr 21, 2023 · 9 comments

Comments

@marc-on-github
Copy link

Access to fetch at 'https://analytics.xx.com/api/send' from origin 'https://xx.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

@mikecao
Copy link
Collaborator

mikecao commented Apr 22, 2023

Nothing has changed on the CORS end of things and we are running the same codebase in production. Is it possible you have something else sending different headers?

@mauricerenck
Copy link

mauricerenck commented Apr 22, 2023

I do have the same issue and was wondering because I didn't change anything. What I saw then, is that I get an error 503 which results in this CORS message (in firefox). Maybe have a look if that is happening with your setup, too. That cors message may be confusing.

In general umami keeps crashing as soon as a request is sent from a website.

error Command failed with signal "SIGKILL".
ERROR: "start-server" exited with 1.
error Command failed with exit code 1.

I run this on a koyeb instance. This keeps happening with new and old migrated mysql databases. Maybe have a look in your logs, to see if something similar is happening.

@jazerix
Copy link

jazerix commented Apr 23, 2023

I am experiencing the same in my instance. It worked fine before migration. Service is running as it should, and Umami is reporting no errors in the cli.

@mauricerenck
Copy link

I am experiencing the same in my instance. It worked fine before migration. Service is running as it should, and Umami is reporting no errors in the cli.

I had to upgrade the machine to micro, after that it's working fine. Running not from docker but directly from the repo showed a nextjs error saying it needs more RAM.

@marc-on-github
Copy link
Author

Okay for me, the error was that I was still on Node version 14. After the Update to Node 16 everything works again.

@BradNut
Copy link

BradNut commented Apr 25, 2023

Nothing has changed on the CORS end of things and we are running the same codebase in production. Is it possible you have something else sending different headers?

I had the same issue described in this bug and, like @marc-on-github, upgrading from Node version 14 to 16 allowed everything to work correctly without CORS issues. My deploy and issue was on Vercel.

Maybe the minimum Node version requirements differ on different platform deployed?

@X-Ryl669
Copy link

X-Ryl669 commented Apr 26, 2023

Nope, on a Debian Buster system it also requires a more recent Node version than 14. I'm using NodeJS 18 LTS and it works.

@RamaHerbin
Copy link

Hello everyone,
I have a similar issue when I post login credential to the /api/auth/login endpoint.

I request from my front-end on localhost:3000 to umami on localhost:8080

The request works fine in Postman.
What am I doing wrong ?

  fetch("http://localhost:8080/api/auth/login", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      'Accept': '*/*',
      "Access-Control-Allow-Headers": "*",
      "Access-Control-Allow-Methods": "*",
      "Access-Control-Allow-Origin": "*",
    },
    body: JSON.stringify(formState),
  })

Screenshot 2023-04-28 at 13 59 16

@mdestafadilah
Copy link

same here, i'm using v2 with node v18. now cors has issued.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants