Chrome security updates may block public websites from requesting assets from private local servers (localhost). To fix this in the Shopify Theme Editor, enable the tunnel feature in the vite-plugin-shopify configuration to create a public HTTPS connection.
Starting with v4.1.0, the plugin automatically sets server.cors defaults and configures server.allowedHosts when tunnel: true is enabled.
export default defineConfig({
plugins: [
shopify({ tunnel: true }),
tailwindcss()
],
server: {
allowedHosts: ['.trycloudflare.com'],
cors: {
origin: [
/^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/,
/\.myshopify\.com$/
]
}
}
})