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

Unknown Jade/XML Error #128

Closed
krrishd opened this issue Oct 16, 2013 · 12 comments
Closed

Unknown Jade/XML Error #128

krrishd opened this issue Oct 16, 2013 · 12 comments
Labels

Comments

@krrishd
Copy link

krrishd commented Oct 16, 2013

For some reason, I'm getting this error without any indication of what the problem is:

SyntaxError
Unexpected token ILLEGAL
Your Harp app could not be built because of a SyntaxError
in/home/krrishd/Documents/github/blog/_harp/rss.xml.jade

    1| doctype xml
    2| rss(version = "2.0")
    3|  for item, slug in public.post.data
    4|   item
    5|    title #{item.title}
    6|    date #{item.date}
    7|    link http://krrishd.github.io/blog/post/#{slug}
    8|    tags
    9|     each tag in #{item.tags}
   10|      tag #{tag}
@kennethormandy
Copy link
Collaborator

I think the problem is with item.tags, would it be possible to post the corresponding portion of the _data.json file in post/?

@krrishd
Copy link
Author

krrishd commented Oct 17, 2013

Here it is:

{
    "the-spelling-bee": {
        "layout":"_layout",
        "title": "The Spelling Bee",
        "date": "16 Oct 2013",
        "tags": ["education", "academia"]
    },
    "why-im-not-using-ghost": {
        "layout": "_layout",
        "title": "Why I'm Not Using Ghost",
        "date": "15 Oct 2013",
        "tags": ["development", "nodejs", "blogging"]
    },
    "im-krish": {
        "layout": "_layout",
        "title": "I'm Krish",
        "date": "14 Oct 2013",
        "tags": [ "introduction", "thoughts" ]
    }
}

@kennethormandy
Copy link
Collaborator

Oh, sorry, I see the problem now. You want this:

each tag in item.tags
    tag #{tag}

Wrapping things like with #{ and } lets you mix JavaScript alongside something else. Since the each statement is JavaScript, you don’t need to interpolate to use item.tags. Generally, where you do want it is somewhere like this:

link http://krrishd.github.io/blog/post/#{slug}

…as you’ve done. You’re mixing other content and a variable, so that’s the right place for it.

@krrishd
Copy link
Author

krrishd commented Oct 17, 2013

But isn't it already like

tag #{tag}

@krrishd
Copy link
Author

krrishd commented Oct 17, 2013

never mind, i see what you're saying. Thanks, it worked :)

@kennethormandy
Copy link
Collaborator

Sorry, should have left that part out. I mean on the each statement. You have each tag in #{item.tags} and it needs to be each tag in item.tags.

@krrishd
Copy link
Author

krrishd commented Oct 17, 2013

also, another quick thing, whenI try to compile:

/usr/lib/node_modules/harp/node_modules/terraform/lib/helpers/raw.js:427
  filePath = filePath.replace(/^\/|\/$/g, '')
                      ^
RangeError: Maximum call stack size exceeded

@andrewboni
Copy link

@krrishd I'm also running into the

/usr/lib/node_modules/harp/node_modules/terraform/lib/helpers/raw.js:427
  filePath = filePath.replace(/^\/|\/$/g, '')
                      ^
RangeError: Maximum call stack size exceeded

Were you able to resolve it?

@andrewboni
Copy link

I was able to resolve my issue- I was using Grunt in conjunction with Harp, which put a node_modules folder in the root directory. My guess is that folder was messing up the compilation.

My solution was to just use Harp in framework mode (by creating a harp.json file in the root and a public folder).

@sintaxi
Copy link
Owner

sintaxi commented May 16, 2014

Andrew, may I ask why do you have a node_modules folder in your root?
Browerify?

-b

On Fri, May 16, 2014 at 3:29 PM, Andrew Boni [email protected]:

I was able to resolve my issue- I was using Grunt in conjunction with
Harp, which put a node_modules folder in the root directory. My guess is
that folder was messing up the compilation.

My solution was to just use Harp in framework mode (by creating a
harp.json file in the root and a public folder).


Reply to this email directly or view it on GitHubhttps://github.com//issues/128#issuecomment-43386188
.

@andrewboni
Copy link

I have some Grunt dev tasks running with Harp. Namely, grunt-contrib-watch, grunt-contrib-livereload, grunt-s3, and grunt-contrib-imagemin.

Is there a way to have this functionality with Harp natively?

@kennethormandy
Copy link
Collaborator

We’re discussing how #275 could solve this by ignoring node_modules , more people are running into the same problem. Thanks for your contributions here, feel free to comment there if you have more thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants