Skip to content

Commit 27adce3

Browse files
Recommended config (#214)
1 parent 3e4ad87 commit 27adce3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/guide/troubleshooting.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,23 @@ The recent CORS errors in the Shopify Theme Editor are caused by a Google Chrome
118118
To fix this, we recommend enabling the [`tunnel`](https://shopify-vite.barrelny.com/guide/configuration.html#tunnel) feature directly in your `vite-plugin-shopify` configuration.
119119
Alternatively, you can use external tools like ngrok to manually expose your server. Both methods create a public HTTPS connection,
120120
allowing the Theme Editor to bypass the restriction and correctly load your local assets.
121+
122+
::: code-group
123+
124+
```diff [vite.config.js]
125+
// https://vitejs.dev/config/
126+
export default defineConfig({
127+
- plugins: [shopify(), tailwindcss()],
128+
+ plugins: [shopify({ tunnel: true }), tailwindcss()],
129+
server: {
130+
cors: {
131+
origin: [defaultAllowedOrigins, /\.myshopify\.com$/]
132+
- }
133+
+ },
134+
+ allowedHosts: ['.trycloudflare.com']
135+
},
136+
build: {
137+
rollupOptions: {
138+
139+
```
140+
:::

0 commit comments

Comments
 (0)