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

include .html with variables go wrong #61

Open
1aron opened this issue Apr 17, 2019 · 0 comments
Open

include .html with variables go wrong #61

1aron opened this issue Apr 17, 2019 · 0 comments

Comments

@1aron
Copy link

1aron commented Apr 17, 2019

index.html

<div class="x-4 h-full">
    {% include '../shared/_picker.html' with {start: 0, end: 9} %}
</div>

shared/_picker.html

{% for index in start..end %}
    <a class="picker-item f-orange">{{ index }}</a>
{% endfor %}

Above, It compile correctly but output the following errors. My test results tell me that because the parameter of the{% for %} tag is the incoming dynamic variable (with), this error is caused.

TypeError: low.charCodeAt is not a function
    at Object.range (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:4334:30)
    at Object.Twig.expression.operator.parse (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:3506:44)
    at Twig.Template.parse (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:2134:46)
    at expressionToken (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:3117:51)
    at next (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:7996:24)
    at Object.forEachAsync [as forEach] (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:8007:16)
    at Twig.Template.<anonymous> (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:3099:31)
    at Object.potentiallyAsync (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:7743:48)
    at Twig.Template.Twig.expression.parse (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:3098:27)
    at Twig.Template.Twig.expression.parseAsync (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:7690:38)

However, if I change the _picker.html extension to _picker.twig It will work, but I don't want my team to use it.

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

1 participant