Blank document crashes application in Meteor #149

Closed
juanpastas opened this Issue Mar 9, 2013 · 10 comments

Comments

Projects
None yet
2 participants
@juanpastas

Hi, when I have a blank blade page, I get this:

Your app is crashing. Here's the latest log.

Errors prevented startup:
Exception while bundling application:
SyntaxError: Parser error: Expected blank line, block definition, block modifier (i.e. append, prepend, or replace), block render, c-style block comment, code, comment, constant block, doctype, event handler, filter, foreach else block, foreach list block, function call, function definition, include, isolate, line of text, preserve block or tag but end of input found.

@ghost ghost assigned bminer Mar 9, 2013

@bminer

This comment has been minimized.

Show comment Hide comment
@bminer

bminer Mar 9, 2013

Owner

Hmm... never thought about this case before. Yeah... a blank Blade template is invalid according to the Blade parser. Would you like this to be fixed?

Obviously a workaround is to simply include something in the Blade template. Even a //- comment will work, but it won't render as anything.

Owner

bminer commented Mar 9, 2013

Hmm... never thought about this case before. Yeah... a blank Blade template is invalid according to the Blade parser. Would you like this to be fixed?

Obviously a workaround is to simply include something in the Blade template. Even a //- comment will work, but it won't render as anything.

@juanpastas

This comment has been minimized.

Show comment Hide comment
@juanpastas

juanpastas Mar 9, 2013

yes, 👍

yes, 👍

@juanpastas

This comment has been minimized.

Show comment Hide comment
@juanpastas

juanpastas Mar 9, 2013

Another thing, can you help me with this?, I am starting an application with Meteor, and:

include 'shared/map'         # this does not work
!= Template 'shared/map'     # this does

I have map.blade file in my_app/client/views/shared/ directory.

Another thing, can you help me with this?, I am starting an application with Meteor, and:

include 'shared/map'         # this does not work
!= Template 'shared/map'     # this does

I have map.blade file in my_app/client/views/shared/ directory.

@bminer

This comment has been minimized.

Show comment Hide comment
@bminer

bminer Mar 10, 2013

Owner

what version of blade are you running? A recent update might have fixed your issue.

Owner

bminer commented Mar 10, 2013

what version of blade are you running? A recent update might have fixed your issue.

@juanpastas

This comment has been minimized.

Show comment Hide comment
@juanpastas

juanpastas Mar 10, 2013

I have v3.0.0rc5 in smart.lock file.

I have v3.0.0rc5 in smart.lock file.

@bminer

This comment has been minimized.

Show comment Hide comment
@bminer

bminer Mar 11, 2013

Owner

@juanpastas - Could you post the contents of map.blade along with the full stack trace of the Error message you are getting? Also, Blade 3.0.0rc6 will correct the "Blank document" issue.

Owner

bminer commented Mar 11, 2013

@juanpastas - Could you post the contents of map.blade along with the full stack trace of the Error message you are getting? Also, Blade 3.0.0rc6 will correct the "Blank document" issue.

@bminer bminer closed this in 26f3de8 Mar 11, 2013

@juanpastas

This comment has been minimized.

Show comment Hide comment
@juanpastas

juanpastas Mar 11, 2013

It just has a placeholder:

script src='https://maps.googleapis.com/maps/api/js?sensor=false'
.map the map

Also I would like the script tag to be included correctly, I think I am going to do this with a javascript helper, unless you have another suggestion, for example using blocks, I actually did not understand why blocks are not recommended with Meteor.

It just has a placeholder:

script src='https://maps.googleapis.com/maps/api/js?sensor=false'
.map the map

Also I would like the script tag to be included correctly, I think I am going to do this with a javascript helper, unless you have another suggestion, for example using blocks, I actually did not understand why blocks are not recommended with Meteor.

@bminer

This comment has been minimized.

Show comment Hide comment
@bminer

bminer Mar 12, 2013

Owner

A few things...

1.) Your code in map.blade should probably read:

script(src='https://maps.googleapis.com/maps/api/js?sensor=false')
.map the map

2.) Could you post the full stack trace of your error message?
3.) Blocks are not recommended in Meteor for a few reasons. Check this out: https://github.com/bminer/node-blade/wiki/Using-Blade-with-Meteor#wiki-block_limitations

Owner

bminer commented Mar 12, 2013

A few things...

1.) Your code in map.blade should probably read:

script(src='https://maps.googleapis.com/maps/api/js?sensor=false')
.map the map

2.) Could you post the full stack trace of your error message?
3.) Blocks are not recommended in Meteor for a few reasons. Check this out: https://github.com/bminer/node-blade/wiki/Using-Blade-with-Meteor#wiki-block_limitations

@juanpastas

This comment has been minimized.

Show comment Hide comment
@juanpastas

juanpastas Mar 12, 2013

  1. actually I would want script to be included in head, how could I do that?
  2. I am not having errors, what I am trying to do is 1)
  3. that's difficult to understand for me, because I don't know which are the ways to work with templates in Meteor, I always see a template inside another template,
  1. even in startup body is populated with a template with Handlebars
  2. I am doing this to start showing my first template with Blade:
#Meteor.startup ->
$ ->
  a = ->
    $('body').html( Template['meals/index']() )
  setTimeout a, 100 # just because a weird error spawning from jQuery mobile
  #a= -> $('body').html( Template.mobile() )
  #setTimeout a,100

meals/index

p index
!= Template['shared/map']()

shared/map

script(src='https://maps.googleapis.com/maps/api/js?sensor=false')
.map the map

Do you have a sample application for blade?

  1. actually I would want script to be included in head, how could I do that?
  2. I am not having errors, what I am trying to do is 1)
  3. that's difficult to understand for me, because I don't know which are the ways to work with templates in Meteor, I always see a template inside another template,
  1. even in startup body is populated with a template with Handlebars
  2. I am doing this to start showing my first template with Blade:
#Meteor.startup ->
$ ->
  a = ->
    $('body').html( Template['meals/index']() )
  setTimeout a, 100 # just because a weird error spawning from jQuery mobile
  #a= -> $('body').html( Template.mobile() )
  #setTimeout a,100

meals/index

p index
!= Template['shared/map']()

shared/map

script(src='https://maps.googleapis.com/maps/api/js?sensor=false')
.map the map

Do you have a sample application for blade?

@bminer

This comment has been minimized.

Show comment Hide comment
@bminer

bminer Mar 13, 2013

Owner

1.) Put it in head.blade
2.) See above
3.) Agreed. Having a template within another template is basically using the include statement. Blocks, in these cases, aren't necessary.
4.) Blade was just changed (in 3.0.0 stable) to support dynamic body.blade templates. The contents of this template are rendered just after the initial page load. See https://github.com/bminer/node-blade/wiki/Using-Blade-with-Meteor for more details.
5.) The whole setTimeout call should not be necessary if you are using Meteor.startup, correct? Otherwise, your templates look fine. Just make sure that you put your <script> tag in head.blade.

Hope that helps. Please feel free to email me or open another issue, if necessary. My contract info is here: http://blakeminer.com/contact.php

Owner

bminer commented Mar 13, 2013

1.) Put it in head.blade
2.) See above
3.) Agreed. Having a template within another template is basically using the include statement. Blocks, in these cases, aren't necessary.
4.) Blade was just changed (in 3.0.0 stable) to support dynamic body.blade templates. The contents of this template are rendered just after the initial page load. See https://github.com/bminer/node-blade/wiki/Using-Blade-with-Meteor for more details.
5.) The whole setTimeout call should not be necessary if you are using Meteor.startup, correct? Otherwise, your templates look fine. Just make sure that you put your <script> tag in head.blade.

Hope that helps. Please feel free to email me or open another issue, if necessary. My contract info is here: http://blakeminer.com/contact.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment