Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file.includes is not a function #159

Closed
mralexho opened this issue Oct 16, 2020 · 4 comments
Closed

file.includes is not a function #159

mralexho opened this issue Oct 16, 2020 · 4 comments

Comments

@mralexho
Copy link

mralexho commented Oct 16, 2020

emulsify-drupal:^2.0

node version: v14.8.0

yarn version: v1.22.4

What you did:
Manually upgrade emulsify-drupal from ^1.0@beta to ^2.0

What happened:
Experiencing errors with file.includes is not a function

Problem description:
Hi @evanmwillhite, I found your ticket twigjs/twig.js#682 about nested includes and was wondering if you found a solution already. I was able to fix by removing namespaces in one of my components. I tried reverting twigjs from v1.15.2 to v.1.13.3 but that seemed to cause other problems.

I noticed in this repo's components, the article page include a grid organism, which include a heading atom so it doesn't seem like you're running into this issue anymore.

┆Issue is synchronized with this Jira Story by Unito

@Exilent-Jask
Copy link

Having same issue when using a block that uses embed multiple times

@evanmwillhite
Copy link

I didn't notice it as much on a newer project I worked on, which made me wonder if they slipped in a fix in one of the Twig.js releases. But if they haven't and you still experience the issue, the workaround we were using basically just moves to using extends instead of embed on any nested files so something like this:

From:

{% embed "@whatever/file.twig" with {
  variable1: 'something'
} %}
 {% block ... %}
 {% endblock %}
{% endembed %}

To:

{% set variable1 = 'something' %}

{% extends "@whatever/file.twig" %}
  {% block ... %}
  {% endblock %}

@mralexho
Copy link
Author

@evanmwillhite okay I just realized namespaces is not the culprit but rather including templates with embed. I see your modifications 2bcf6dd to get it working.

I'll see if I can change our templates as they are pretty complex.

@ccjjmartin
Copy link
Contributor

This PR fixes this issue for me: twigjs/twig.js#784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants