Axios v1 Upgrade: CORS Error Triggered by useCache: true Option
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu bằng cách lần theo quá trình tích hợp axios của frontend-platform và tùy chọn useCache: true. Tái hiện lỗi CORS, xác định xem đó là cảnh báo không dùng nữa hay một thay đổi khác, rồi xác minh hành vi đã chọn với các request sử dụng bộ nhớ đệm phía client.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A recent upgrade to axios v1 in frontend-platform caused a CORS error for what appears to be single API call (as far as we have been able to tell) in Enterprise Learner Portal MFE, though it's largely unclear whether it potentially impacts more APIs than this one.
The JavaScript error associated with the failed request suggests the following:
request header field cache-control is not allowed
It was identified that the MFE calling this affected API was using the opt-in useCache: true option, to enable client-side caching on responses to this API for performance optimizations and preventing loading states where possible.
The CORS error was resolved by removing the useCache: true option, which results in the pre-flight OPTIONS request to pass the CORS check and resolve the response successfully.
If running into CORS errors on requests due to the above error, check if you're using useCache: true; if so, the recommendation is to opt out of frontend-platform's client-side caching baked into the axios HTTP client, in favor of relying on other, more widely accepted means of client-side caching (e.g., with @tanstack/react-query).
We may consider adding a deprecation warning when useCache: true is used, as a "use-at-your-own-risk" sort of warning but likely to also mention its eventual deprecation.
- Ngôn ngữ chính
- JavaScript
- Star
- 38
- Fork
- 90
- Merge trung bình
- 3 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của openedx/frontend-platform
-
a11y
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
openedx/frontend-platform#745 · 3 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
openedx/frontend-platform#892 · 4 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
openedx/frontend-platform#837 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
openedx/frontend-platform#835 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
openedx/frontend-platform#833 ·
Tất cả issue của openedx/frontend-platform
Issue tương tự
-
marketing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
enhancement good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Static_Chess#163 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Account menu (footer ⚙) doesn't dismiss on outside click — stays open and covers the Bot listĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Fei2411/DeepSeek-Bot#1693 ·
-
area-templates triage:bot-seen triage:needs-human
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/aspire#22356 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày