You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use assetPrefix to serve the static assets from a single domain for our multi-domain application.
When deploying Next.js to Vercel, access-control-allow-origin: * is being returned to HEAD requests to the assets.
When deploying with OpenNext on Cloudflare, no such header is returned. It prevents our client side from fetching certain resources stored as assets.
Steps to reproduce
Store a file in the public/ directory
Set assetPrefix to a custom domain also configured on the Cloudflare Worker
Deploy the application with OpenNext on the Cloudflare Worker
Try loading the assets from the client side from the other domain
Notice it fails with a CORS error
Expected behavior
OpenNext should set a access-control-allow-origin: * on these assets, similar to how Vercel does
@opennextjs/cloudflare version
1.0.0-beta.3
Wrangler version
3.112.0
next info output
No relevant here
Additional context
No response
The text was updated successfully, but these errors were encountered:
headers are not applied to static assets at the moment, we'd need to implement this opennextjs/opennextjs-aws#707 for it to work.
I don't think we should create this file automatically from the headers config, it will lack too much of the options in headers like has or missing.
I guess for now we could just add something in the docs about that
Describe the bug
We use
assetPrefix
to serve the static assets from a single domain for our multi-domain application.When deploying Next.js to Vercel,
access-control-allow-origin: *
is being returned to HEAD requests to the assets.When deploying with OpenNext on Cloudflare, no such header is returned. It prevents our client side from fetching certain resources stored as assets.
Steps to reproduce
public/
directoryassetPrefix
to a custom domain also configured on the Cloudflare WorkerExpected behavior
OpenNext should set a
access-control-allow-origin: *
on these assets, similar to how Vercel does@opennextjs/cloudflare version
1.0.0-beta.3
Wrangler version
3.112.0
next info output
Additional context
No response
The text was updated successfully, but these errors were encountered: