I am using https://github.com/Kyon147/laravel-shopify this package to develop the Shopify app using the Laravel 11 version. Frontend engine REACT.
App Bridge is the latest.
This is my app.blade.php file:
<head>
<meta name="shopify-api-key" content="xxx" />
<script src="https://cdn.shopify.com/shopifycloud/app-bridge.js"></script>
@viteReactRefresh
@vite('resources/js/index.tsx')
</head>
<body>
<div id="app"><!--index.jsx injects App.jsx here--></div>
</body>
And this is the index.tsx file:
import React from 'react';
import App from './App'
import '@shopify/polaris/build/esm/styles.css';
import ReactDOM from 'react-dom/client';
const root = document.createElement('div');
document.body.appendChild(root);
ReactDOM.createRoot(root).render(<App />);
But giving the below error. Blade is getting perfectly but not index.tsx file.
Show More
Blocked script execution in '[details=Show More]
Access to script at ‘http://127.0.0.1:5173/@vite/client’ from origin ‘https://3385-103-95-97-72.ngrok-free.app’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.