Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

[Bug]: Erroneous MissingTemplate errors when not using default directory structure (supplying [ ROOT ] to theme serve) #649

Closed
2 tasks done
peepers-rick opened this issue Apr 11, 2022 · 13 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@peepers-rick
Copy link

peepers-rick commented Apr 11, 2022

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

What type of project are you working on?

theme

Expected behavior

Using shopify theme serve [ ROOT ] where the root is not the default directory structure should NOT result in theme-check(MissingTemplate) for all snippets and sections.``

Actual behavior

Using shopify theme serve [ ROOT ] where the root is not the default directory structure shows errors for valid sections and snippets

Stack trace

No response

Reproduction steps

  1. Create theme with non-standard directory structure, example, put assets, config, layout, locales, etc, in a src folder
  2. Run shopify theme serve src
  3. Observe that all {% render %} {% include %} {% section %} tags result in a theme-check(MissingTemplate). If you try to click through, it ignores the root (in this case src) and looks directly at the default root directory.

Operating System

Windows 10

CLI version (run shopify version if you're not sure)

2.15.3

Shell

zsh

Ruby version (run ruby -v if you're not sure)

3.0.1p64

What language and version are you using in your application?

Liquid

@peepers-rick peepers-rick changed the title [Bug]: Erroneous MissingTemplate errors when not using default directory structure [Bug]: Erroneous MissingTemplate errors when not using default ROOT directory structure Apr 11, 2022
@peepers-rick peepers-rick changed the title [Bug]: Erroneous MissingTemplate errors when not using default ROOT directory structure [Bug]: Erroneous MissingTemplate errors when not using default directory structure (supplying [ ROOT ] to theme serve) Apr 11, 2022
@gonzaloriestra
Copy link

Hi! Sorry for the late response.

I'm not able to reproduce it, but we are investigating what could be happening.

@gonzaloriestra
Copy link

Could you please share a screenshot with the errors?

@peepers-rick
Copy link
Author

peepers-rick commented Apr 25, 2022

Hi @gonzaloriestra ,
No problem. I've attached a screenshot. This is a template located at theme/templates/page.info.liquid. The MissingTemplate error is appearing on {% section 'info-hero' %} which definitely exists at theme/sections/info-hero.liquid. This happens for all section and snippet files. I'm running shopify theme serve theme (the 2nd theme to indicate the root of the theme is the theme folder. The error indicates 'sections/info-hero.liquid' is not found theme-check (MissingTemplate) which indicates to me it's probably looking at the default root, not the theme root I specified via shopify theme serve theme.
missingtemplate

@github-actions
Copy link

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.

→ If there's no activity within a week, then a bot will automatically close this.

Thanks for helping to improve Shopify's dev tooling and experience.

@peepers-rick
Copy link
Author

I'm still having this issue with the latest version of shopify-cli (currently 2.20.1)

@github-actions
Copy link

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.

→ If there's no activity within a week, then a bot will automatically close this.

Thanks for helping to improve Shopify's dev tooling and experience.

@peepers-rick
Copy link
Author

I'm still having this issue with the latest version of shopify-cli (currently 2.29)

@gonzaloriestra
Copy link

cc @Shopify/theme-developer-tools

@karreiro karreiro transferred this issue from Shopify/shopify-cli Oct 28, 2022
@karreiro karreiro added good first issue Good for newcomers bug Something isn't working labels Oct 28, 2022
@Poitrin Poitrin self-assigned this Nov 14, 2022
@Poitrin
Copy link
Contributor

Poitrin commented Nov 14, 2022

I was able to reproduce the issue.
It's important to mention here that shopify theme check src does not return any MissingTemplate error (when a root is defined), but that the Shopify Liquid VS Code extension does not (can't?) take into account any root.
I will come back with more info soon, thanks for creating this issue!

@Poitrin
Copy link
Contributor

Poitrin commented Nov 14, 2022

@peepers-rick – Is your issue related/the same as Shopify/theme-check-vscode#79 ?
If yes, can you…

  1. add root: src to your .theme-check.yml
  2. reload VS Code

14-00-dcrzq-5elkb

… to see whether the error disappears?

@peepers-rick
Copy link
Author

@Poitrin that fixed it! Thanks! Sorry I didn't even realize I had theme check installed to be honest with you, I thought it was all through shopify-cli

@Poitrin
Copy link
Contributor

Poitrin commented Nov 14, 2022

@peepers-rick – Awesome, thanks for the quick reply!
I will close the issue then. And yes, I agree, It's indeed a little confusing that "Theme Check" stands for multiple projects/tools, but my team is already aware of this :)

@Poitrin Poitrin closed this as completed Nov 14, 2022
@bakura10
Copy link

Hi,

I'm trying to migrate from PHPStorm to VS Code, but I am facing the same issue and I can't solve it.

I have created a workspace in VS Code where one folder = one theme.

Each theme has its own .theme-check.yml, and properly reference the dist folder in the root option:

image

Despite being properly set up, it constantly raise missing templates for all includes (there are, of course, in the folder):

image

How can I make this work?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants