Skip to content

Deploy on vercel [blocked by CORS policy: No 'Access-Control-Allow-Origin'] #22

@abdulaziz-git

Description

@abdulaziz-git

Hi, I tried to deploy on vercel,
I have setup env variable on Vercel, If i try to post using PostMan it success and the file is stored on my AWS S3 bucket.
But if i try post using excalidraw app, I got error
Access to fetch at 'https://excalidraw-json-omega.vercel.app/api/v2/post/' from origin 'https://draw.qrku.net' 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.

I have tried add EXCALIDRAW_ALLOWED_ORIGIN with value'*' also 'https://draw.qrku.net,http://draw.qrku.net,draw.qrku.net'
and also tried without quote, but still the same error

I'm also try creating next.config.js according to this article https://vercel.com/support/articles/how-to-enable-cors#enabling-cors-in-a-next.js-app

Can you help @NMinhNguyen ?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions