Replies: 1 comment
-
duplicate |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a cra app which I would like to migrate to vite. All the steps are done. we use aws cloudfront to serve the assets with files being uploaded to s3.
We serve the vite build via rails server.
First request goes to rails server, we fetch the index.html from cdn and we will serve it to the browser. But when I deploy this to staging, we are getting CORS Error.
eg. request rails server for the page, we will get index.html with assets to .js and .css with cdn url. It gives cors error.
We were doing the same with create react app. But it was working fine. Now, with vite, it is giving CORS error for starter files.. On observation between the two, I have found one difference in the request headers.
Sec-Fetch-Mode: no-cors --> for react build
Sec-Fetch-Mode: cors --> for vite build
I have tried almost everything. Nothing worked. Any help is greatly appreaciated
Beta Was this translation helpful? Give feedback.
All reactions