question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

maizzle build production not always resolve nested <component>

See original GitHub issue
  • Maizzle Version: Framework v3.7.3
  • Maizzle Version: CLI v1.4.0
  • Node.js Version: v16.13.

I’m unable to reproduce it constantly, but it seems that sometimes (without changing anything from the code) Maizle is having problems to resolve nested components like this (see the teaser component nested to content component)

<extends src="src/layouts/main.html">
  <block name="template">
    <!-- HEADER -->
    <component
      src="src/components/header.html"
      locals='{"url": "{{social.website}}"}'
    >
      <img
        class="w-[274px] sm:w-[188px]"
        src="https://s3.com/images/email.png"
        alt="Website"
      />
    </component>
    <!-- CONTENT -->
    <component
      src="src/components/content.html"
      locals='{"contentCtaUrl": "https://www.example.com", "contentCtaText": "Cta text"}'
    >
      <!-- EXAMPLE OF CUSTOM CONTENT ADDED UNDER BODY -->
      <component
        src="src/components/teaser.html"
        locals='{"teaserUrl": "https://www.example.com", "teaserText": "Teaser text"}'
      >
      </component>
    </component>
    <!-- FOOTER -->
    <component src="src/components/footer.html">
      <img
        class="w-[274px] sm:w-[188px]"
        src="https://s3.com/images/email.png"
        alt="Website"
      />
    </component>
  </block>
</extends>

do you know any problem similar to this? I’m saying that is not rendering because if I go to see the produced output in build_poduction I see that inside the code I have a <component>

Also, I have another question: if we have nested components, is it a problem if I use the same name for the locals? I would expect that they respect the scope/hierarchy but just to be sure that it was not the problem (of the not rendering properly) I changed it back to have unique names (it’s less clean and scalable)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cossssmincommented, May 26, 2022

Only if you plan on using them 😃

0reactions
cossssmincommented, May 26, 2022

Not doing anything in that sense, yarn has probably cached your dependencies.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deeply(?) nested components only rendering intermittently #369
Maizzle Version: 2.6.0 Node.js Version: 12.18.3 I have a project I ... maizzle build production not always resolve nested <component> #693.
Read more >
Build process | Maizzle
First, a global configuration object is computed by merging your Environment config on top of the base config.js . For example, running maizzle...
Read more >
Components | Maizzle
Components help you organize blocks of markup that you use often by extracting them to a file, so you can reuse them in...
Read more >
Events | Maizzle
You may use Events both when developing locally with the CLI build or serve commands, and when using the API with the render()...
Read more >
@maizzle/framework: Versions | Openbase
This prerelease fixes an issue with destination directories for templates in nested folders when developing locally, and updates posthtml-modules to fix an ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found