There is no problem not worth solving, and no technology not worth learning!

Reasons why the preview banner is not displayed when analyzing a Shopify CLI previewing a local theme

查看 http://127.0.0.1:9292 ,预览本地主题时,预览横幅未显示

1. Shopify background preview theme Sense, only reserve the parameter (preview_theme_id): gethttps://shuijingwanwq-development.myshopify.com/?preview_theme_id=130698641593. Preview banners are displayed. Figure 1, Figure 2

Shopify 后台预览主题 Sense,仅保留参数(preview_theme_id):GET https://shuijingwanwq-development.myshopify.com/?preview_theme_id=130698641593
Figure 1

 

预览横幅显示
Figure 2

2. Execute the command in Shopify CLI: Shopify Theme dev –verbose , open this URL in the browser:http://127.0.0.1:9292, which can preview the theme in development of the current local environment. as shown in Figure 3

在 Shopify CLI 中执行命令:shopify theme dev --verbose ,在浏览器中打开此网址:http://127.0.0.1:9292 ,可预览当前本地环境的正在开发中的主题
Figure 3

┃ Serving .
┃
┃ Please open this URL in your browser:
┃ http://127.0.0.1:9292
┃
┃ Customize this theme in the Theme Editor, and use 'theme pull' to get the changes:
┃ https://shuijingwanwq-development.myshopify.com/admin/themes/133598314681/editor
┃
┃ Share this theme preview:
┃ https://shuijingwanwq-development.myshopify.com/?preview_theme_id=133598314681
┃
┃ (Use Ctrl-C to stop)
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ (4.34s) ━━━
[2023-03-09 10:01:13] INFO WEBrick 1.7.0
[2023-03-09 10:01:13] INFO ruby 3.1.1 (2022-02-18) [x64-mingw-ucrt]
[2023-03-09 10:01:13] INFO WEBrick::HTTPServer#start: pid=5384 port=9292
DEBUG Refreshing preview _secure_session_id cookie
DEBUG Proxying HEAD https://shuijingwanwq-development.myshopify.com/?preview_theme_id=133598314681&_fd=0&pb=0
DEBUG `-> 302 request_id: 38f7af92-8e4d-408a-be4c-a3c1e289d479
DEBUG Proxying GET https://shuijingwanwq-development.myshopify.com/?_fd=0&pb=0
DEBUG `-> 302 request_id: 03d906fc-6399-4eb7-87cf-e34a2f345397


3. Viewhttp://127.0.0.1:9292, the preview banner is not displayed when previewing the local theme. as shown in Figure 4

查看 http://127.0.0.1:9292 ,预览本地主题时,预览横幅未显示
Figure 4

4. Through step 3, it can be confirmed that the parameters of the proxy to the online website are added: _fd=0&pb=0 . The complete word of pb should be: preview bar. Add parameters to the request URL in step 1: pb=0, the preview banner is no longer displayed. as shown in Figure 5

通过步骤 3 ,可确认代理至线上网址的参数多出了:_fd=0&pb=0 ,经过尝试,可以确认预览横幅是否显示是基于参数:pb 进行控制的。pb 的完整单词应该是:preview bar。在步骤 1 的请求网址中添加参数:pb=0,预览横幅不再显示
Figure 5

Need long-term technical maintenance or remote troubleshooting?

I am a PHP / Go backend engineer with 15+ years of experience, focused on existing system maintenance, bug fixing, performance optimization, server troubleshooting, WordPress maintenance, and small feature iterations.

If your project is facing any of the following issues, we can start with a small troubleshooting task first:

  • ✅ PHP / Laravel / Yii2 legacy systems without active maintenance
  • ✅ Go / Gin backend APIs that need troubleshooting or optimization
  • ✅ Slow, broken, or unstable WordPress websites
  • ✅ Nginx / MySQL / Redis / Linux server issues
  • ✅ CDN / Cloudflare / DNS / HTTPS configuration problems
  • ✅ Long-term remote technical support or part-time maintenance

More details: About Me & Collaboration

WeChat: 13980074657
Email: shuijingwanwq@gmail.com
Telegram: @shuijingwan
GitHub: https://github.com/shuijingwan

评论

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.