mozilla / nunjucks

A powerful templating engine with inheritance, asynchronous control, and more (jinja2 inspired)
https://mozilla.github.io/nunjucks/
BSD 2-Clause "Simplified" License
8.48k stars 635 forks source link

installJinjaCompat break filters #1373

Open beeing opened 2 years ago

beeing commented 2 years ago

Hi, I'm trying to add the JinjaCompat but after running this, the other custom filters I added previously was not working anymore.

    nunjucksEnvironment.addFilter('myfilter', function (arr) {
      console.log(arr)
      return arr
    })

The above will return undefined after calling installJinjaCompat but arr was the array value before that.

Is this something that is expected or the JinjaCompat should only add extra functionalities to Nunjucks?

Thanks!

ogonkov commented 2 years ago

Can you create repo with this error?