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

Error after docpad update #710

Closed
marisks opened this issue Nov 17, 2013 · 17 comments
Closed

Error after docpad update #710

marisks opened this issue Nov 17, 2013 · 17 comments

Comments

@marisks
Copy link

marisks commented Nov 17, 2013

I created new project with HTML5 boilderplate with Jade and Less skeleton. Then run docpad update to update to latest version and get this error:

warning: Something went wrong while rendering: default.html.jade
D:\Projects\blog\DocPad\2blog\src\layouts\default.html.jade:18
    16|         meta(name="viewport", content="width=device-width, initial-scal=1")
    17|         //Place favicon.ico and apple-touch-icon.png in the root directry
  > 18|         != getBlock('meta').add(site.meta).toHTML()
    19|         != getBlock("styles").add(site.styles).toHTML()
    20|         script(src="js/vendor/modernizr-2.6.2.min.js")
    21| body

Cannot read property 'id' of undefined
warning: Something went wrong while rendering: index.html.jade
D:\Projects\blog\DocPad\2blog\src\layouts\default.html.jade:18
    16|         meta(name="viewport", content="width=device-width, initial-scal=1")
    17|         //Place favicon.ico and apple-touch-icon.png in the root directry
  > 18|         != getBlock('meta').add(site.meta).toHTML()
    19|         != getBlock("styles").add(site.styles).toHTML()
    20|         script(src="js/vendor/modernizr-2.6.2.min.js")
    21| body

Cannot read property 'id' of undefined
error: Something went wrong with the action
error: An error occured:
TypeError: D:\Projects\blog\DocPad\2blog\src\layouts\default.html.jade:18
    16|         meta(name="viewport", content="width=device-width, initial-scal=1")
    17|         //Place favicon.ico and apple-touch-icon.png in the root directry
  > 18|         != getBlock('meta').add(site.meta).toHTML()
    19|         != getBlock("styles").add(site.styles).toHTML()
    20|         script(src="js/vendor/modernizr-2.6.2.min.js")
    21| body

Cannot read property 'id' of undefined
    at MetaCollection._.extend.set (D:\Projects\blog\DocPad\2blog\node_modules\ocpad\node_modules\backbone\backbone.js:683:21)
    at MetaCollection.ElementsCollection.set (D:\Projects\blog\DocPad\2blog\nod_modules\docpad\out\lib\collections\elements.js:41:40)
    at MetaCollection._.extend.add (D:\Projects\blog\DocPad\2blog\node_modules\ocpad\node_modules\backbone\backbone.js:632:19)
    at MetaCollection.ElementsCollection.add (D:\Projects\blog\DocPad\2blog\nod_modules\docpad\out\lib\collections\elements.js:36:40)
    at eval (eval at <anonymous> (D:\Projects\blog\DocPad\2blog\node_modules\dopad-plugin-jade\node_modules\jade\lib\jade.js:152:8), <anonymous>:85:50)
    at D:\Projects\blog\DocPad\2blog\node_modules\docpad-plugin-jade\node_moduls\jade\lib\jade.js:153:35
    at JadePlugin.render (D:\Projects\blog\DocPad\2blog\node_modules\docpad-pluin-jade\out\jade.plugin.js:89:72)
    at ambi (D:\Projects\blog\DocPad\2blog\node_modules\docpad\node_modules\amb\out\lib\ambi.js:23:18)
    at Task.<anonymous> (D:\Projects\blog\DocPad\2blog\node_modules\docpad\nodemodules\event-emitter-grouped\out\lib\event-emitter-grouped.js:38:23)
    at ambi (D:\Projects\blog\DocPad\2blog\node_modules\docpad\node_modules\amb\out\lib\ambi.js:23:18)
    at fire (D:\Projects\blog\DocPad\2blog\node_modules\docpad\node_modules\tasgroup\out\lib\taskgroup.js:159:23)
    at b (domain.js:183:18)
    at Domain.run (domain.js:123:23)
    at Task.fire (D:\Projects\blog\DocPad\2blog\node_modules\docpad\node_module\taskgroup\out\lib\taskgroup.js:166:25)
    at process._tickDomainCallback (node.js:459:13)

I am using Windows.

The only strange thing in output when upgrading docpad was this:

D:\Projects\blog\DocPad\2blog\node_modules\docpad-plugin-livereload\node_module\ws>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\nodemodules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.trgets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Tolset = 'v100') cannot be found. To build using the v100 build tools, please insall Visual Studio 2010 build tools.  Alternatively, you may upgrade to the currnt Visual Studio tools by selecting the Project menu or right-click the solutio, and then selecting "Upgrade Solution...". [D:\Projects\blog\DocPad\2blog\nodemodules\docpad-plugin-livereload\node_modules\ws\build\bufferutil.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.trgets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Tolset = 'v100') cannot be found. To build using the v100 build tools, please insall Visual Studio 2010 build tools.  Alternatively, you may upgrade to the currnt Visual Studio tools by selecting the Project menu or right-click the solutio, and then selecting "Upgrade Solution...". [D:\Projects\blog\DocPad\2blog\nodemodules\docpad-plugin-livereload\node_modules\ws\build\validation.vcxproj]

But previous version work also without Visual Studio 2010 (I have VS2013 installed only).

@greduan
Copy link
Contributor

greduan commented Nov 17, 2013

Sorry to hear you're having trouble Māris. Could you please try removing the .add(site.meta) part and see if it works without it? Thanks! :)

@marisks
Copy link
Author

marisks commented Nov 17, 2013

Yes, it started to work. Also if I add empty "meta" to "site" config, then everything is fine. Why it work in previous version?

@greduan
Copy link
Contributor

greduan commented Nov 17, 2013

I have no idea myself. What version was the previous version you were using?

@marisks
Copy link
Author

marisks commented Nov 17, 2013

Previous version was 6.54.4, but it was local version only for HTML5 boilerplate skeleton. Global version was latest already, so I had only to run "docpad update".
Current version is 6.54.6.

Seems that adding "meta" to config fixed the issue for me. But HTML5 boilerplate skeleton does not work with latest version and probably other skeletons which uses site config similar way.

@marisks
Copy link
Author

marisks commented Nov 17, 2013

Looks like this commit might cause the issue:
e2a89e2#diff-c01da13a6c75672069e4da77f358a271

@balupton
Copy link
Member

Found the issue. fixing now.

balupton added a commit that referenced this issue Nov 17, 2013
@balupton
Copy link
Member

Should be fixed up with v6.54.7 with 4622688#diff-e6948c0fbbce10ea9b720d5249d50c1dR1838

@marisks
Copy link
Author

marisks commented Nov 17, 2013

Thanks! That was fast :)

@marisks
Copy link
Author

marisks commented Nov 17, 2013

Actually just tried to create new project using same skeleton and have same issue. It works fine until "docpad update". Version now is 6.54.7.

@greduan
Copy link
Contributor

greduan commented Nov 17, 2013

Yeah skeletons determine which version of DocPad they want to use. So basically the skeleton was using an older version until you updated it.

@balupton
Copy link
Member

Actually just tried to create new project using same skeleton and have same issue. It works fine until "docpad update". Version now is 6.54.7.

I can't reproduce this problem...

@marisks
Copy link
Author

marisks commented Nov 21, 2013

Now I have global version of docpad: 6.54.9
Steps to reproduce issue:

>md newblog
>cd newblog
>docpad run
3. HTML5 Boilerplate with Jade and LESS
>3
>Ctrl+C
>Y
>docpad --version
6.53.4 (local)
>docpad update
>docpad run

D:\Projects\blog\DocPad\newblog\src\layouts\default.html.jade:18
    16|         meta(name="viewport", content="width=device-width, initial-scale=1")
    17|         //Place favicon.ico and apple-touch-icon.png in the root directory
  > 18|         != getBlock('meta').add(site.meta).toHTML()
    19|         != getBlock("styles").add(site.styles).toHTML()
    20|         script(src="js/vendor/modernizr-2.6.2.min.js")
    21| body

Cannot read property 'id' of undefined
warning: Something went wrong while rendering: index.html.jade
D:\Projects\blog\DocPad\newblog\src\layouts\default.html.jade:18
    16|         meta(name="viewport", content="width=device-width, initial-scale=1")
    17|         //Place favicon.ico and apple-touch-icon.png in the root directory
  > 18|         != getBlock('meta').add(site.meta).toHTML()
    19|         != getBlock("styles").add(site.styles).toHTML()
    20|         script(src="js/vendor/modernizr-2.6.2.min.js")
    21| body

Cannot read property 'id' of undefined
error: Something went wrong with the action
error: An error occured:
TypeError: D:\Projects\blog\DocPad\newblog\src\layouts\default.html.jade:18
    16|         meta(name="viewport", content="width=device-width, initial-scale=1")
    17|         //Place favicon.ico and apple-touch-icon.png in the root directory
  > 18|         != getBlock('meta').add(site.meta).toHTML()
    19|         != getBlock("styles").add(site.styles).toHTML()
    20|         script(src="js/vendor/modernizr-2.6.2.min.js")
    21| body

Cannot read property 'id' of undefined
    at MetaCollection._.extend.set (D:\Projects\blog\DocPad\newblog\node_modules\docpad\node_modules\backbone\backbone.js:683:21)
    at MetaCollection.ElementsCollection.set (D:\Projects\blog\DocPad\newblog\node_modules\docpad\out\lib\collections\elements.js:41:40)
    at MetaCollection._.extend.add (D:\Projects\blog\DocPad\newblog\node_modules\docpad\node_modules\backbone\backbone.js:632:19)
    at MetaCollection.ElementsCollection.add (D:\Projects\blog\DocPad\newblog\node_modules\docpad\out\lib\collections\elements.js:36:40)
    at eval (eval at <anonymous> (D:\Projects\blog\DocPad\newblog\node_modules\docpad-plugin-jade\node_modules\jade\lib\jade.js:152:8), <anonymous>:85:50)
    at D:\Projects\blog\DocPad\newblog\node_modules\docpad-plugin-jade\node_modules\jade\lib\jade.js:153:35
    at JadePlugin.render (D:\Projects\blog\DocPad\newblog\node_modules\docpad-plugin-jade\out\jade.plugin.js:89:72)
    at ambi (D:\Projects\blog\DocPad\newblog\node_modules\docpad\node_modules\ambi\out\lib\ambi.js:23:18)
    at Task.<anonymous> (D:\Projects\blog\DocPad\newblog\node_modules\docpad\node_modules\event-emitter-grouped\out\lib\event-emitter-grouped.js:38:23)
    at ambi (D:\Projects\blog\DocPad\newblog\node_modules\docpad\node_modules\ambi\out\lib\ambi.js:23:18)
    at fire (D:\Projects\blog\DocPad\newblog\node_modules\docpad\node_modules\taskgroup\out\lib\taskgroup.js:159:23)
    at b (domain.js:183:18)
    at Domain.run (domain.js:123:23)
    at Task.fire (D:\Projects\blog\DocPad\newblog\node_modules\docpad\node_modules\taskgroup\out\lib\taskgroup.js:166:25)
    at process._tickDomainCallback (node.js:459:13)

@Delapouite
Copy link
Contributor

Your local version appears to remain 6.53.4. Did you try to update it through a classic npm update after changing the version number in your package.json?

@marisks
Copy link
Author

marisks commented Nov 21, 2013

If I run "docpad --version" it shows:

v6.54.9 (local installation: D:\Projects\blog\DocPad\newblog\node_modules\docpad)

package.config now contains 6.54.9 version for docpad and even after "npm update" error appears.

@pflannery
Copy link
Contributor

I see your problem...the docpad.config is missing the meta block...add a meta block to your templateData in the docpad.config. (if your not sure where to look in the file then search for this text "# The website's scripts" and put the below code after the scripts array)

        meta: [
            '<meta name="author" content="fred" />'
        ]

I think the html boilerplate needs this fix too...also Cannot read property 'id' of undefined could probably be better explained like, missing config templateData entry: 'meta'

@balupton
Copy link
Member

Ohhhh right. I get the problem now.

balupton added a commit that referenced this issue Nov 22, 2013
- Fixed #710 by defaulting values to array if not set
- Updated deps
- Cleaned up some balUtil.flow calls
@marisks
Copy link
Author

marisks commented Nov 24, 2013

Thanks, great! Now it works with latest version.

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

5 participants