Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
With the Online Store 2.0 stuff, are you guys using the whole git subtree method mentioned in the shopify/git docs (https://shopify.dev/themes/best-practices/version-control) ? I've been putting src/ folder in my theme and it's working fine, but they don't mention that as a viable option in the docs.
I've just tested this approach and it does work. I think the reason they don't list it as a viable option is because you can't plug a Github action directly to the main repo, and you have to keep the contents of the assets folder under version control for them to be deployed. For the former that means you need to run your build commands locally. As for the latter, having assets part of the repo would be a requirement anyway, so it appears to be a viable workflow to me too.
Have either of you managed to go down the subtree route yet? I too have a src folder in my root and everything seems to be working ( anything outside of Shopify's theme structure is ignored ). I can't seem to get my head around splitting the production code out.
The problem is that if you have assets/Build folder inside your project, you will get this error while executing a lightouse action in github:
Configuring shopify CLI
Will run Lighthouse CI on https://***
==============================
Creating development theme
This command ran with ID: 50863
Please include this information in any issues/report along with relevant logs
/root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/file.rb:20:in `read': Is a directory @ io_fread - assets/Build (Errno::EISDIR)
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/file.rb:20:in `read'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/file.rb:20:in `read'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/file.rb:57:in `checksum'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:291:in `file_has_changed?'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:193:in `enqueue'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:42:in `block in enqueue_updates'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:42:in `each'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:42:in `enqueue_updates'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:152:in `upload_theme!'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/project_types/theme/commands/push.rb:55:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/sub_command.rb:13:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/command.rb:19:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:16:in `block (2 levels) in call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:37:in `block (2 levels) in with_logging'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb:169:in `with_id'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:36:in `block in with_logging'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui.rb:176:in `log_output_to'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:35:in `with_logging'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:15:in `block in call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:45:in `block (2 levels) in with_traps'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:51:in `twrap'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:44:in `block in with_traps'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:43:in `with_traps'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:14:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/core/executor.rb:15:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/core/entry_point.rb:24:in `block in call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/core/monorail.rb:20:in `log'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/core/entry_point.rb:23:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/bin/shopify:33:in `block in <main>'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:75:in `handle_abort'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:21:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/bin/shopify:32:in `<main>'
==============================
Configuring Lighthouse CI
Fetching product handle
Using 2-case-bundle
Fetching collection handle
Using best-sellers
==============================
Running Lighthouse CI
.lighthouseci/ directory writable
Configuration file found
Chrome installation found
GitHub token set
Healthcheck passed!
Getting a new page...
Getting preview cookie...
Error: Protocol error (Page.navigate): Cannot navigate to invalid URL
at /.node/lib/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:217:63
at new Promise (<anonymous>)
at CDPSession.send (/.node/lib/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:216:16)
at navigate (/.node/lib/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:108:47)
at FrameManager.navigateFrame (/.node/lib/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:91:13)
at Frame.goto (/.node/lib/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:416:41)
at Page.goto (/.node/lib/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:1133:53)
at module.exports (/github/workspace/setPreviewCookies.js:18:14)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async PuppeteerManager.invokePuppeteerScriptForUrl (/.node/lib/node_modules/@lhci/cli/src/collect/puppeteer-manager.js:108:5)
I can't see a reason to use subtree at all. Just maintain the current theme folder structure and have your build process put files into assets.
I have just finished setting up webpack to compile scss, and translate/compile js as well. The output files go into the assets folder and all is well! My `npm run dev` command uses 'concurrently' to run webpack along side 'shopify theme serve'.
Hello Sandy,
In your approach how do you ensure that you have everything under version control while also being able to make use of the Shopify Github Integration?
I am currently trying to set up the Shopify Github Integration with my theme project that uses gulp to compile sass and es6 javascript into the asset folder of my theme.
I've sent everything that I want to use for production into a dist/ folder and was trying to use a subtree to store the dist, but was having issues.
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025