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

yarn run watch errors with message 'feature' is undefined #638

zoubin opened this issue Dec 13, 2017 · 4 comments

yarn run watch errors with message 'feature' is undefined #638

zoubin opened this issue Dec 13, 2017 · 4 comments


Copy link

@zoubin zoubin commented Dec 13, 2017


I was trying to build material locally by following the contributing guide.
The setting up process was good, but yarn run watch errored.
Here is the log:

yarn run v1.3.2
$ make -j watch
rm -rf material
/Users/zoubin/Workspace/mt/mkdocs-material/mkdocs-material/node_modules/.bin/webpack --watch
while [ ! -d "./material" ]; do sleep 1; done

Webpack is watching the files…

Looking for Modernizr references

>> 7 matches in src/assets/javascripts/application.js
>> checked, dataset, details, fetch, json, svg, target

>> 1 match in src/assets/stylesheets/extensions/pymdown/_details.scss
>> details

>> 1 match in src/assets/stylesheets/layout/_sidebar.scss
>> csstransforms3d

>> 1 match in src/assets/stylesheets/layout/_nav.scss
>> csstransforms3d

>> Ready to build using these settings:
>> addTest, setClasses
>> Your file will be minified with UglifyJS

Building your customized Modernizr...OK
Hash: 727960a8
Version: webpack 3.8.1
Time: 5536ms
                                          Asset     Size  Chunks                    Chunk Names
                                      main.html  1.16 kB          [emitted]
              assets/images/icons/bitbucket.svg   1.4 kB          [emitted]
                 assets/images/icons/gitlab.svg  1.65 kB          [emitted]
              assets/javascripts/application.js   754 kB       0  [emitted]  [big]  assets/javascripts/application
                assets/javascripts/modernizr.js  27.2 kB       1  [emitted]         assets/javascripts/modernizr
             assets/stylesheets/application.css  87.5 kB       0  [emitted]         assets/javascripts/application
     assets/stylesheets/application-palette.css  44.8 kB       0  [emitted]         assets/javascripts/application
             assets/javascripts/lunr/lunr.da.js  10.3 kB          [emitted]
             assets/javascripts/lunr/  13.9 kB          [emitted]
             assets/javascripts/lunr/lunr.du.js  15.1 kB          [emitted]
             assets/javascripts/lunr/  24.4 kB          [emitted]
             assets/javascripts/lunr/  20.9 kB          [emitted]
             assets/javascripts/lunr/  25.7 kB          [emitted]
             assets/javascripts/lunr/  21.3 kB          [emitted]
             assets/javascripts/lunr/  24.1 kB          [emitted]
             assets/javascripts/lunr/  5.05 kB          [emitted]
          assets/javascripts/lunr/lunr.multi.js  3.12 kB          [emitted]
             assets/javascripts/lunr/  9.95 kB          [emitted]
             assets/javascripts/lunr/  22.1 kB          [emitted]
             assets/javascripts/lunr/  23.2 kB          [emitted]
             assets/javascripts/lunr/  19.1 kB          [emitted]
assets/javascripts/lunr/  13.5 kB          [emitted]
             assets/javascripts/lunr/  9.63 kB          [emitted]
             assets/javascripts/lunr/  38.3 kB          [emitted]
             assets/javascripts/lunr/tinyseg.js  22.9 kB          [emitted]
                      assets/images/favicon.ico  1.15 kB          [emitted]
                      assets/images/favicon.png  1.06 kB          [emitted]
                            0 bytes          [emitted]
                               mkdocs_theme.yml  2.62 kB          [emitted]
                                       404.html  1.25 kB          [emitted]
                                      base.html    12 kB          [emitted]
                 assets/images/icons/github.svg  1.18 kB          [emitted]
                           partials/footer.html  3.87 kB          [emitted]
                           partials/header.html  3.43 kB          [emitted]
                             partials/hero.html  1.44 kB          [emitted]
           partials/integrations/analytics.html  2.38 kB          [emitted]
              partials/integrations/disqus.html  1.62 kB          [emitted]
                         partials/language.html  1.56 kB          [emitted]
                      partials/language/da.html  1.82 kB          [emitted]
                      partials/language/de.html  1.84 kB          [emitted]
                      partials/language/en.html  1.82 kB          [emitted]
                      partials/language/es.html  1.87 kB          [emitted]
                      partials/language/fr.html  1.87 kB          [emitted]
                      partials/language/it.html  1.79 kB          [emitted]
                      partials/language/ja.html  1.89 kB          [emitted]
                      partials/language/kr.html  1.88 kB          [emitted]
                      partials/language/nl.html  1.86 kB          [emitted]
                      partials/language/no.html  1.81 kB          [emitted]
                      partials/language/pl.html  1.88 kB          [emitted]
                      partials/language/pt.html  1.88 kB          [emitted]
                      partials/language/ru.html  2.04 kB          [emitted]
                      partials/language/sv.html  1.82 kB          [emitted]
                 partials/language/zh-Hant.html  1.85 kB          [emitted]
                      partials/language/zh.html  1.84 kB          [emitted]
                         partials/nav-item.html  3.71 kB          [emitted]
                              partials/nav.html  2.05 kB          [emitted]
                           partials/search.html  2.27 kB          [emitted]
                           partials/social.html  1.59 kB          [emitted]
                           partials/source.html  2.18 kB          [emitted]
                        partials/tabs-item.html  2.49 kB          [emitted]
                             partials/tabs.html  1.58 kB          [emitted]
                         partials/toc-item.html   1.6 kB          [emitted]
                              partials/toc.html  2.72 kB          [emitted]
   [0] ./src/assets/javascripts/providers/jsx.js 3.04 kB {0} [built]
   [2] (webpack)/buildin/global.js 488 bytes {0} [built]
   [4] ./src/assets/javascripts/modernizr.js 53 bytes {1} [built]
   [5] ./.modernizr-autorc 7.29 kB {1} [built]
   [6] ./src/assets/javascripts/application.js 18.1 kB {0} [built]
   [7] ./src/assets/images/icons/bitbucket.svg 79 bytes {0} [built]
   [8] ./src/assets/images/icons/github.svg 76 bytes {0} [built]
   [9] ./src/assets/images/icons/gitlab.svg 76 bytes {0} [built]
  [10] ./src/assets/stylesheets/application.scss 41 bytes {0} [built]
  [11] ./src/assets/stylesheets/application-palette.scss 41 bytes {0} [built]
    + 44 hidden modules
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--3-1!node_modules/postcss-loader/lib/index.js??postcss!node_modules/sass-loader/lib/loader.js??ref--3-3!src/assets/stylesheets/application.scss:
       [0] ./node_modules/css-loader?{}!./node_modules/postcss-loader/lib?{"ident":"postcss","plugins":[null,null]}!./node_modules/sass-loader/lib/loader.js?{"includePaths":["node_modules/modularscale-sass/stylesheets","node_modules/material-design-color","node_modules/material-shadows"]}!./src/assets/stylesheets/application.scss 90.1 kB {0} [built]
        + 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--4-1!node_modules/postcss-loader/lib/index.js??postcss!node_modules/sass-loader/lib/loader.js??ref--4-3!src/assets/stylesheets/application-palette.scss:
       [0] ./node_modules/css-loader?{}!./node_modules/postcss-loader/lib?{"ident":"postcss","plugins":[null,null]}!./node_modules/sass-loader/lib/loader.js?{"includePaths":["node_modules/modularscale-sass/stylesheets","node_modules/material-design-color","node_modules/material-shadows"]}!./src/assets/stylesheets/application-palette.scss 47 kB {0} [built]
        + 1 hidden module
mkdocs serve
INFO    -  Building documentation...
INFO    -  Cleaning site directory
ERROR   -  Error building page extensions/
Traceback (most recent call last):
  File "/usr/local/bin/mkdocs", line 11, in <module>
  File "/usr/local/lib/python2.7/site-packages/click/", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/", line 644, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/", line 464, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mkdocs/", line 127, in serve_command
  File "/usr/local/lib/python2.7/site-packages/mkdocs/commands/", line 117, in serve
    config = builder()
  File "/usr/local/lib/python2.7/site-packages/mkdocs/commands/", line 112, in builder
    build(config, live_server=live_server, dirty=dirty)
  File "/usr/local/lib/python2.7/site-packages/mkdocs/commands/", line 282, in build
    build_pages(config, dirty=dirty)
  File "/usr/local/lib/python2.7/site-packages/mkdocs/commands/", line 242, in build_pages
    _build_page(page, config, site_navigation, env)
  File "/usr/local/lib/python2.7/site-packages/mkdocs/commands/", line 158, in _build_page
    output_content = template.render(context)
  File "/usr/local/lib/python2.7/site-packages/jinja2/", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/site-packages/jinja2/", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/zoubin/Workspace/mt/mkdocs-material/mkdocs-material/material/main.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "/Users/zoubin/Workspace/mt/mkdocs-material/mkdocs-material/material/base.html", line 104, in top-level template code
    {% block hero %}
  File "/Users/zoubin/Workspace/mt/mkdocs-material/mkdocs-material/material/base.html", line 106, in block "hero"
    {% include "partials/hero.html" with context %}
  File "/Users/zoubin/Workspace/mt/mkdocs-material/mkdocs-material/material/partials/hero.html", line 2, in top-level template code
    {% if not feature.tabs %}
  File "/usr/local/lib/python2.7/site-packages/jinja2/", line 397, in getattr
    return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'feature' is undefined
make: *** [watch-mkdocs] Error 1
make: *** Waiting for unfinished jobs....

Expected behavior

[What you expected to happen]

Actual behavior

[What is actually happening]

Steps to reproduce the bug

  1. [First step]
  2. [Second step]
  3. [and so on...]

Package versions

  • Python: 2.7.8
  • MkDocs: 0.17.2
  • Material: a7da5d5

Project configuration

The contents of your mkdocs.yml

System information

  • OS: macOS 10.13.2 Beta 17C67b
  • Browser: [The browser used, if relevant]
Copy link

@squidfunk squidfunk commented Dec 14, 2017

Hmm that's strange as I cannot reproduce it. Which version of Jinja do you have installed?

pip show jinja2

On my machine this prints:

Name: Jinja2
Version: 2.10
Summary: A small but fast and easy to use stand-alone template engine written in pure python.
Author: Armin Ronacher
License: BSD
Location: /Users/squidfunk/Library/Python/2.7/lib/python/site-packages
Requires: MarkupSafe
Copy link

@zoubin zoubin commented Dec 18, 2017

Sorry for the delay.
On my mac,

pip show jinja2


Name: Jinja2
Version: 2.7.3
Summary: A small but fast and easy to use stand-alone template engine written in pure python.
Author: Armin Ronacher
License: BSD
Location: /usr/local/lib/python2.7/site-packages
Requires: markupsafe
Copy link

@squidfunk squidfunk commented Dec 18, 2017

This is a little regression that is incompatible with Jinja 2.7, as Jinja changed the behavior of imports and contexts in 2.9. Upgrading it to >2.9 will fix the issue, but I will also provide a fix shortly.

Copy link

@squidfunk squidfunk commented Dec 18, 2017

Fixed in master and released as 2.2.4

@squidfunk squidfunk closed this Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants