Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DanielRønfeldt's avatar

CORS error when adding Facebook Like button script

Hey guys,

In a Laravel 10 + Inertia + Vue 3 app, I need to add a Facebook Like button to each page. According to the official Facebook documentation https://developers.facebook.com/docs/plugins/like-button/ I added the FB SDK script tag in the main app.blade.php file. However, I'm getting a Cross-Origin Request Blocked error in the browser's console.

How can I make this work?

Thanks!

0 likes
3 replies
DanielRønfeldt's avatar

@martinbean The error says

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v17.0&appId=3444352359113637&autoLogAppEvents=1. (Reason: CORS request did not succeed). Status code: (null).

Please or to participate in this conversation.