patternlab-node: Pattern Lab Reports Missing Patterns in Console
I am using Pattern Lab Node v2.6.2 on Windows | Mac | Linux, with Node v7.4.0, using the Gulp Edition.
Expected Behavior
Although on the frontend there is no issues, I am getting this message in my gulp output:
Could not find pattern referenced with partial syntax molecules-cta. This can occur when a pattern was renamed, moved, or no longer exists but it still called within a different template somewhere.
Now I call molecules-cta in this file source/_patterns/molecules/00-banners/banner.mustache
<div class="c-banner"><div class="c-banner__wrapper">
{{# text }}
<div class="c-banner__text">
<div class="c-banner__text--inner">
// content
<div class="o-actions">
<div class="o-actions__inner">
{{# cta }}
{{> molecules-cta }}
{{/ cta }}
</div>
</div>
</div>
</div>
{{/ text }}
</div>
</div>
I have a similar call in another file source/_patterns/molecules/00-banners/banner-image.mustache
When I remove this from the 1st file:
{{# cta }} {{> molecules-cta }} {{/ cta }}
I no longer see an error looking for that file, so I copied the code exactly from the banner-image.mustache file into the banner.mustache file, but it made no difference, I got the error again.
This has stumped me. Let me know if anymore information is required.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 23 (9 by maintainers)
Can confirm that @jabas analysis seems to be correct. We have the same issue with our PatternLab and resorting the patterns fixes the warnings.
I have this problem and ignored it for a long time because everything was generated correctly in spite of the errors and warnings (). I upgraded to patternlab-node v2.10.0 (after taking the advice from #687) today and still had the same problem but noticed then when I remove the whitespace between the pattern name and the parameters, the errors and warnings disappear.
My structure is as follows:
With the files as follows:
button.mustache
<button>{{ buttonContent }}{{^ buttonContent }}button{{/ buttonContent }}</button>button-list.mustache
<ul><li>{{> atoms-button ("buttonContent": "foo") }}</li></ul>This code generates the following errors:
When I change
button-list.mustacheby eliminating the whitespace betweenatoms-buttonand("buttonContent"the errors and warnings disappear.Errorless button-list.mustache
<ul><li>{{> atoms-button("buttonContent": "foo") }}</li></ul>These two files are the only changes I made to a fresh clone of Pattern Lab Node - Gulp Edition (Tag: 1.4.0), besides the fact that I am running it in a debian virtual box with node v8.6.0 installed.