Object variables not supported

Issue #2 new
Viktor Yakubiv created an issue

I've found a bug when try to render template with object variable.

Part of Gruntfile.js

{
  options: {
    variables: {
      site: {
        name: 'Example name'
      }
    }
  }
}

Template

Template can be simple, e.x.:

<%= @site.name %>

or

<%= @site?.name %>

When I render this template, I have got an error:

TypeError: Cannot read property 'name' of undefined

but this code is valid and executes without errors with pure original ect.js module

When I try to solve this problem updating ect package to latest version I failed. With last version I have the same trouble.

P.S. Please, update package.json with this code:

"dependencies": {
  "ect": ">=0.4.11"
}

Comments (0)

  1. Log in to comment