-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
fix(next-export): CORS errors due to wrong crossorigin
default value
#58200
base: canary
Are you sure you want to change the base?
fix(next-export): CORS errors due to wrong crossorigin
default value
#58200
Conversation
fd3a1d4
to
7a32b1d
Compare
7a32b1d
to
175bbc3
Compare
Is this still working on? |
@ijjk can you approve it? |
Any updates on this fix? This fixes a critical bug still present in Next 14.1 with CORS attributes being incorrectly required |
@leerob could you please review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, can we add a test case for this to prevent regressing?
Can we just merge it and add regression test later @ijjk ? |
Is this abandoned? We are also having an issue with crossorigin scripts. |
While it may not be a solution for everyone, we solved this issue by fronting the Next.js applications with a CDN and then route the static assets to a static storage (Azure Blobs but can be anything depend on which cloud provider you are using). Then we route dynamic paths to web compute tier via CDN. Given static paths going to be relative now, you are not going to face any CORS issues anymore. |
Suffering from this issue myself too... hopefully we get some answers on this soon. |
Is this abandoned? We are having to patch every version for it to work via CDN. |
Hello @ijjk please review again for merge. Lot of people suffering from this issue and there is no update. |
If
corsOrigin
is not specified in nextConfig it becomefalse
and in the following codeIt fallback to empty string
''
, but this is wrong since the default value should beundefined
otherwise we are forcing the client to use ALWAYS CORS for assets as you can see from the MDN Officialcrossorigin
specsome
crossorigin
values can be:anonymous
: Request uses CORS headers and credentials flag is set to 'same-origin'. There is no exchange of user credentials via cookies, client-side TLS certificates or HTTP authentication, unless destination is the same origin.""
: Setting the attribute name to an empty value, like crossorigin or crossorigin="", is the same as anonymous.You can see the Current vs. Expected behavior in the issue
Fixes #57931