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
{{ message }}
This repository was archived by the owner on Jan 27, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,21 @@ Find the `<c:lc_api>` by its `aura:id` then call the `restRequest(..)` method pa
60
60
})
61
61
```
62
62
63
+
# Troubleshooting
64
+
65
+
## "Access Denied" or "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://yourinstance.visualforce.com' is therefore not allowed access."
66
+
67
+
Your request was blocked due to [Cross-Origin Resource Sharing (CORS) policy](https://help.salesforce.com/articleView?id=extend_code_cors.htm&type=5).
68
+
69
+
This can happen when trying to make a request to `/services/apexrest/` endpoint.
70
+
For example, the Visualforce domain hosting `LC_APIPage` is on `https://yourinstance.visualforce.com` and is trying to make a web request to `https://yourinstance.my.salesforce.com/services/apexrest/`.
71
+
Because the two domains do not match, then CORS policy prevents the request.
72
+
73
+
1. In **Setup**, navigate to **Security | CORS**.
74
+
75
+
2. Add the origin URL mentioned in your error message (e.g. `https://yourinstance.visualforce.com`) to the list of whitelisted domains.
76
+
77
+
63
78
# Credits
64
79
65
80
[Doug Ayers](https://douglascayers.com) develops and maintains the project.
0 commit comments