Weird Node js error

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I am not much familiar with node js, but I was forced to use node js to launch on heroku.

It all went smoothly, probably until a few days ago, but I didn't know why but it suddenly gives this much error.

Error: /app/index.jade:9
  7| meta(name='viewport', content='target-densitydpi=device-dpi, width=device-width, user-scalable=no, maximum-scale=1, minimum-scale=1')
  8| link(rel='stylesheet', href='/stylesheets/bootstrap.min.css', media='screen')
> 9| link(rel='stylesheet', href='stylesheets/jquery-ui.css', media='screen')   
 10| link(rel='stylesheet', href='stylesheets/jquery.pnotify.default.css', media='screen')
 11| link(rel='stylesheet', href='stylesheets/jquery.pnotify.default.icons.css', media='screen')
 12| link(rel='stylesheet', href='stylesheets/app.css', media='screen') 

 unexpected text at Object.Lexer.fail (/app/node_modules/jade/lib/lexer.js:804:11)
 at Object.Lexer.next (/app/node_modules/jade/lib/lexer.js:863:15)
 at Object.Lexer.lookahead (/app/node_modules/jade/lib/lexer.js:113:46)
 at Parser.lookahead (/app/node_modules/jade/lib/parser.js:111:23)
 at Parser.peek (/app/node_modules/jade/lib/parser.js:88:17)
 at Parser.tag (/app/node_modules/jade/lib/parser.js:704:22)
 at Parser.parseTag (
                                                
                                                
0 views
0 shares
profilepic.png
manpreet 2 years ago

 

Try changing your Jade to

doctype html
html(lang="en")
  head
    meta(name='apple-mobile-web-app-capable', content='yes')
    meta(name='apple-mobile-web-app-status-bar-style', content='black')
    meta(name='viewport', content='target-densitydpi=device-dpi, width=device-width, user-scalable=no, maximum-scale=1, minimum-scale=1')
    link(rel='stylesheet', href='/stylesheets/bootstrap.min.css', media='screen')
    link(rel='stylesheet', href='/stylesheets/jquery-ui.css', media='screen')  
    link(rel='stylesheet', href='/stylesheets/jquery.pnotify.default.css', media='screen')
    link(rel='stylesheet', href='/stylesheets/jquery.pnotify.default.icons.css', media='screen')

As @Max Leske said in the comments, you are mixing relative and absolute paths.

Not sure why that would be causing an issue, but it's more than a coincidence I feel.

Incidently, the reason I asked to see your package.json is because recently there was an update to Jade on NPM that has caused the issue you are reporting:


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.